eslint-config-anvilabsdeprecated

Anvilabs' base ESLint config

Usage no npm install needed!

<script type="module">
  import eslintConfigAnvilabs from 'https://cdn.skypack.dev/eslint-config-anvilabs';
</script>

README

eslint-config-anvilabs

Version Dependency Status devDependency Status

Anvilabs' base ESLint config. Makes use of prettier for formatting.

Usage

This config relies dangerously on npm@3/yarn flatter tree for its dependencies (because of eslint/issues/3458), so installation may be as simple as:

$ yarn add eslint prettier eslint-config-anvilabs --dev
# or
$ npm install eslint prettier eslint-config-anvilabs --save-dev

Then add the extends to your .eslintrc.js:

module.exports = {
  extends: 'anvilabs',
  rules: {
    // your overrides
  },
};

Other configs

This config also exposes a few other configs that we use often and pull in as needed.

You can use them standalone:

module.exports = {
  extends: 'anvilabs/<config-name>',
};

Or in combination with the base config (recommended):

module.exports = {
  extends: ['anvilabs', 'anvilabs/<config-name>'],
};

You can also use ESLint@4 overrides to apply a config only to certain files. For example:

module.exports = {
  ...
  overrides: [
    Object.assign(
      {
        files: ['**/__tests__/*-test.js', '**/__mocks__/*.js'],
      },
      require('eslint-config-anvilabs/jest')
    ),
  ],
};

Available configs include:

Things to know

  • Running ESLint will report an error if your code does not match prettier style. The rule is autofixable – if you run ESLint with the --fix flag, your code will be formatted according to prettier style.

License

MIT License © Anvilabs LLC