npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aesop-engineering/code-styles

v2.2.0

Published

A set of configs for popular code linting and formatting tools used by Aesop.

Downloads

2,251

Readme

aesop-code-styles

The goal of this project is to locate the linting and formatting rules we use in one location. These exported configurations can then be used by our various code bases to provide consistent code.

Usage

Installation

npm install -D @aesop-engineering/code-styles

Eslint

This library exports different eslint configurations for different environments (node, browser) and languages (JS, TS). The exported configurations are:

  • node
  • node-ts
  • browser
  • browser-ts

In your eslint config file extend the eslint configuration most relevant to your package using one of the above. For example, for a frontend written in TS

// .eslintrc.js

module.exports = {
  extends: ['./node_modules/@aesop-engineering/code-styles/eslint/browser-ts.js'],
};

Note: the environment for the browser eslint configurations does not include Node. This will cause eslint to complain when module.exports or Node global variables such as __dirname are accessed. This is intentional to prevent using them in the code that will be shipped to the browser. To correctly address this for files that run in Node, such as babel.config.js please do one of:

  1. Add this comment to the top of the file /* eslint-env node */

  2. Override the default behaviour for those files to manually set the environment by adding the following to the eslint config in the project

    "overrides": [
        {
          "files": ["babel.config.js", "other files running in Node"],
          "env": {
            "node": true
          }
        }
      ]

Prettier

In your prettier config file, import the prettier configuration exported by this package

// .prettierrc.js

module.exports = {
  ...require('@aesop-engineering/code-styles/.prettierrc'),
};

Stylelint

In your stylelint config file, extend the stylelint configuration exported by this package

// stylelint.config.js

module.exports = {
  extends: ['@aesop-engineering/code-styles/stylelint.config.js'],
};

Contributing

This repo enforces commit message formats as they are used to automatically version the package using semantic versioning.

To add/or change the rules in this repo:

  1. branch off from main
  2. make the changes you wish to make. Ensure you use the correct commit type, otherwise the version might not be incremented
  3. raise a PR to main, ensuring to get reviews from as many members of the dev team as possible
  4. merge and wait for a new version to be published

Publishing new versions

To publish to NPM this repo uses the X_NPM_TOKEN from the Aesop org secrets.

Note that this secret will expire on 1st June 2024.