0.14.4 โ€ข Published 5 months ago

@code-pushup/eslint-config v0.14.4

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

@code-pushup/eslint-config

npm License: MIT

Recommended ESLint presets by Code PushUp.

โš™๏ธ Configs

StackConfigDescription
javascriptjavascriptDefault config, suitable for any JavaScript/TypeScript project.
typescripttypescriptConfig for strict TypeScript projects.
nodejsnodeConfig for Node.js projects.
angularangularConfig for Angular projects.
ngrxngrxConfig for Angular projects using NgRx library.
reactreactConfig for React projects.
graphqlgraphqlConfig for GraphQL servers implemented in Node.js.
jestjestConfig for projects using Jest for testing.
vitestvitestConfig for projects using Vitest for testing.
cypresscypressConfig for projects using Cypress for testing.
playwrightplaywrightConfig for projects using Playwright for testing.
storybookstorybookConfig for projects using Storybook for UI components.
testing-libraryreact-testing-libraryConfig for projects using React Testing Library for testing.

Some configs extend other configs, as illustrated below. So, for example, extending angular config implicitly extends typescript and javascript configs as well.

  graph BT;
    typescript --extends--> javascript
    node --extends--> javascript
    angular --extends--> typescript
    ngrx --extends--> angular
    react --extends--> javascript
    graphql --extends--> node

๐Ÿ—๏ธ Setup

To use the default config, follow these steps:

  1. You must first install all the required peer dependencies (if you haven't already):

    npm install -D eslint @eslint/js eslint-plugin-{functional,import,promise,sonarjs,unicorn} globals typescript-eslint
  2. Install @code-pushup/eslint-config with:

    npm install -D @code-pushup/eslint-config
  3. Include default config in your ESLint configuration file (usually eslint.config.js):

    import javascript from '@code-pushup/eslint-config/javascript.js';
    import tseslint from 'typescript-eslint';
    
    export default tseslint.config(...javascript);

Depending on your tech stack, you may wish to extend other configs as well (listed above). This will require installing additional peer dependencies. For more details, refer to setup docs for the configs you're interested in using.

๐Ÿ“ฆ Peer dependencies

All peer dependencies used by @code-pushup/eslint-config are listed below, along with their supported versions. Only the default config's dependencies are required, others are optional.

NPM packageVersionRequired
eslinteslint^9.0.0โœ…
eslint@eslint/js^9.0.0โœ…
lambdaeslint-plugin-functional^7.0.0 \|\| ^8.0.0 \|\| ^9.0.0โœ…
importeslint-plugin-import^2.31.0โœ…
importeslint-import-resolver-typescript^3.0.0
promiseeslint-plugin-promise>=6.4.0โœ…
sonareslint-plugin-sonarjs^1.0.4โœ…
unicorneslint-plugin-unicorn>=50.0.0โœ…
globalglobals>=14.0.0โœ…
typescripttypescript-eslint^8.0.0โœ…
graphql@graphql-eslint/eslint-plugin^3.0.0
ngrx@ngrx/eslint-plugin^18.0.0 \|\| ^19.0.0
vitest@vitest/eslint-plugin^1.1.9
angularangular-eslint^18.0.0 \|\| ^19.0.0
cypresseslint-plugin-cypress>=3.3.0
jesteslint-plugin-jest^28.8.0
testeslint-plugin-jest-formatting^3.0.0
accessibilityeslint-plugin-jsx-a11y^6.10.0
nodejseslint-plugin-n>=17.0.0
playwrighteslint-plugin-playwright^2.1.0
reacteslint-plugin-react^7.36.0
react_tseslint-plugin-react-hooks>=5.0.0
rxjseslint-plugin-rxjs-x>=0.6.0
storybookeslint-plugin-storybook>=0.10.0
testing-libraryeslint-plugin-testing-library^7.1.1

๐Ÿงช Test overrides

For non-production code, some rules are disabled (or downgraded from errors to warnings).

This applies to file paths matching any of the following globs:

  • **/*.spec.?(c|m)[jt]s?(x)
  • **/*.test.?(c|m)[jt]s?(x)
  • **/__tests__/**/*.?(c|m)[jt]s?(x)
  • **/__mocks__/**/*.?(c|m)[jt]s?(x)
  • **/*.cy.?(c|m)[jt]s?(x)
  • **/*.stories.?(c|m)[jt]s?(x)
  • **/*.e2e.?(c|m)[jt]s?(x)
  • **/*.mock.?(c|m)[jt]s?(x)
  • **/*.mocks.?(c|m)[jt]s?(x)
  • **/test/**/*.?(c|m)[jt]s?(x)
  • **/tests/**/*.?(c|m)[jt]s?(x)
  • **/mocks/**/*.?(c|m)[jt]s?(x)
  • **/testing-utils/**/*.?(c|m)[jt]s?(x)
  • **/test-utils/**/*.?(c|m)[jt]s?(x)
  • **/fixtures/**/*.?(c|m)[jt]s?(x)
  • **/*.config.?(c|m)[jt]s
  • **/.prettierrc.?(c|m)[jt]s
  • **/codegen.?(c|m)[jt]s
  • **/test-setup.?(c|m)[jt]s

๐Ÿซด Contributing

Node.js installation is a prerequisite (LTS version). Install dependencies with NPM:

npm install

To execute tests:

npm test

To generate documentation:

npm run docs
0.11.0

10 months ago

0.10.1

11 months ago

0.12.0

10 months ago

0.10.2

11 months ago

0.13.0

9 months ago

0.10.3

11 months ago

0.14.0

7 months ago

0.13.1

9 months ago

0.10.4

11 months ago

0.14.1

7 months ago

0.13.2

9 months ago

0.10.5

11 months ago

0.14.2

7 months ago

0.10.6

11 months ago

0.14.3

6 months ago

0.10.7

11 months ago

0.14.4

5 months ago

0.10.8

10 months ago

0.10.0

11 months ago

0.9.0

1 year ago

0.9.1

1 year ago

0.8.0

1 year ago

0.6.6

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.6.5

1 year ago

0.7.0

1 year ago

0.6.4

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago