11.0.0 • Published 5 months ago

@guardian/eslint-config v11.0.0

Weekly downloads
646
License
-
Repository
-
Last release
5 months ago

@guardian/eslint-config

ESLint configs for Guardian JavaScript and TypeScript projects.

Installation

npm install --save-dev @guardian/eslint-config

# or
yarn add --dev @guardian/eslint-config

# or
pnpm install --save-dev @guardian/eslint-config

Usage

Example

// eslint.config.js

import guardian from '@guardian/eslint-config';

export default [
	...guardian.configs.recommended,
	...guardian.configs.jest,
	...guardian.configs.react,
	...guardian.configs.storybook,
];

Configs

The package's default export is an object with a configs property that provides configs for different projects.

Some of them are single-purpose, and others compose the single-purpose configs into useful presets.

configs.recommended

Provides a recommended collection of useful configs covering both JavaScript and TypeScript.

Composes:

  • configs.javascript
  • configs.typescript
  • configs.imports
  • configs.comments

configs.javascript

Included in configs.recommended.

Provides a collection of configs for checking JavaScript, which are also applied to TypeScript files.

It automatically detects your project type (using package.json#type), and uses an appropriate config for each file.

Composes:

  • configs.esm
  • configs.cjs

configs.esm

Included in configs.javascript.

Provides a collection of configs for ECMAScript modules.

It assumes everything will be ECMAScript, and will error if you use it on a CommonJS module.

configs.cjs

Included in configs.javascript.

Provides a collection of configs for CommonJS modules.

It assumes everything will be CommonJS, and will error if you use it on an ECMAScript module.

configs.typescript

Included in configs.recommended.

Provides a collection of configs for checking TypeScript.

configs.imports

Included in configs.recommended.

Provides a collection of configs ensuring best practice around module imports and exports.

configs.comments

Included in configs.recommended.

Provides a collection of configs ensuring best practice around code comments.

configs.jest

Provides a collection of configs for checking Jest units tests.

configs.react

Provides a collection of configs for checking React components.

configs.storybook

Provides a collection of configs for checking Storybook stories.

10.0.0

10 months ago

12.0.0

5 months ago

11.0.0

8 months ago

10.0.0-beta.6

11 months ago

10.0.0-beta.7

11 months ago

10.0.0-beta.5

11 months ago

10.0.0-beta.4

11 months ago

10.0.0-beta.2

1 year ago

10.0.0-beta.0

1 year ago

10.0.0-beta.1

1 year ago

9.0.0

1 year ago

8.0.1

1 year ago

8.0.0

1 year ago

7.0.1

2 years ago

7.0.0

2 years ago

6.0.0

2 years ago

5.0.0

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

3.0.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

2.0.0

3 years ago

1.0.0

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

5 years ago

0.4.2

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.2.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago