3.2.1 • Published 3 months ago

@crometrics/eslint-config-crometrics-base v3.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Contains the Cro Metrics' JavaScript linting rules for ESLint.

The intent of our ESLint configs is to provide a common set of rules for coding within the Cro Metrics' codebase. Having installable ESLint configs will streamline and simplify using our style guide across various projects/repos easier.

Installation and Ussage Instructions

  1. Run npx install-peerdeps @crometrics/eslint-config-crometrics-base@latest
  2. Add the package to the extends array/string in your .eslintrc.*.

Example

An example bare bones .eslintrc.* config with no other rules, plugins, extended configs, etc. would look like:

// .eslintrc.cjs

module.exports = {
  extends: ['@crometrics/eslint-config-crometrics-base'],
  overrides: [],
};

Override specific settings by specifying them in the rules object as normal. See http://eslint.org/docs/developer-guide/shareable-configs for more details.

You can add additional extended configs, plugins, rules, globals, parser options, env options, etc. the same as you normally would.

Example

// eslintrc.cjs

module.exports = {
  extends: [
    '@crometrics/eslint-config-crometrics-base',
    'plugin:react/recommended',
  ],
  plugins: ['react'],
  rules: {
    // Any project specific rules or rules for plugins/additional configs here
    'react/no-unescaped-entities': ['off'],
  },
  globals: {
    // Add any project globals here
    PJS: true,
  },
};

Available Configs

See eslint-config-crometrics/packages/ to view all available configs.

Of note, there is a TypeScript configuration for projects that contain any amount of TypeScript.

  • If your project is only JavaScript:
    • Install only this module
  • If your project contains any TypeScript:
    • Install only eslint-config-crometrics-typescript (Link)

IMPORTANT NOTE:

There is no reason to install both eslint-config-crometrics-base and eslint-config-crometrics-typescript in the same project and doing so will give you problems.

Making Changes and Publishing Updates

  1. Make the changes you want to make in /packages/eslint-config-crometrics-base/index.js or /packages/eslint-config-crometrics-base/rules/[filename].js.
  2. Increment version in package.json.
  3. Commit and push changes to the repo.
  4. From the root directory of this repo, run npm publish to publish from the repo to npm.
  5. Run npm update @crometrics/eslint-config-crometrics-base (or simply npm update to update all npm packages) in the projects where the config is installed
  6. Make a post in the #-engineering Slack channel informing others to run npm update @crometrics/eslint-config-crometrics-typescript or npm update as well
3.2.1

3 months ago

3.2.0

3 months ago

3.1.1

3 months ago

3.1.0

4 months ago

3.0.2

4 months ago

3.0.1

4 months ago

3.0.0

4 months ago

2.0.0

9 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago