5.0.12 • Published 3 days ago

eslint-config-rational v5.0.12

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 days ago

eslint-config-rational

Minimal ESLint configuration for reducing version control noise and avoiding common mistakes.

Tenets

  • Prevent code patterns which frequently cause or lead to bugs.
  • Produce consistent source code without requiring functional changes.
  • Prefer rules which are auto-fixable.
  • Avoid rules which require frequent inline disabling.
  • Avoid rules which are already covered by TypeScript.

Getting Started

Install the eslint-config-rational package.

npm i -D eslint-config-rational eslint typescript

Add the rational configuration to your eslint.config.js (flat) configuration file.

import rational from 'eslint-config-rational';

export default rational();

Options

The rational(options?) configuration factory accepts the following options.

  • ignores: Add ESLint global ignores. Defaults to ['**/{.git,node_modules,out,lib,dist}'].
  • jsExtensions: Array of file extensions to lint as JavaScript. Defaults to ['.js', '.cjs', '.mjs', '.jsx'].
  • tsExtensions: Array of file extensions to lint as TypeScript. Defaults to ['.ts', '.cts', '.mts', '.tsx'].
  • jsxExtensions: Array of file extensions to lint as JSX. Defaults to ['.jsx', '.tsx'].
  • relaxedFiles: Array of file paths to lint with relaxed rules. Defaults to ['**/*.test.*', '**/*.spec.*', '**/*.config.*', '**/*.setup.*', '**/.*rc.*', '**/*.story.*', '**/__*', '**/__*/**', '**/.*', '**/.*/**'].
  • enableImports: Enable import rules. Defaults to true.
  • enableUnicorn: Enable unicorn rules. Defaults to true.
  • enableReact: Enable react rules. Defaults to true.
  • enableTypescript: Enable typescript rules. Defaults to true.
  • enableStylistic: Enable ESLint Stylistic rules. Defaults to true.
  • extend: One or more ESLint configurations to extend (nested arrays allowed).
  • override: One or more ESLint override configurations (nested arrays allowed).
import rational from 'eslint-config-rational';

export default rational({
  ignores: ['**/{.git,node_modules,out,lib,dist}'],
  jsExtensions: ['.js', '.cjs', '.mjs', '.jsx'],
  tsExtensions: ['.ts', '.cts', '.mts', '.tsx'],
  jsxExtensions: ['.jsx', '.tsx'],
  relaxedFiles: [
    '**/*.test.*',
    '**/*.spec.*',
    '**/*.config.*',
    '**/*.setup.*',
    '**/*.story.*',
    '**/__*.*',
    '**/__*/**',
    '**/.*.*',
    '**/.*/**',
  ],
  enableImports: true,
  enableUnicorn: true,
  enableReact: true,
  enableTypescript: true,
  enableStylistic: true,
  extend: [
    // ESLint configuration or (nested) array of configurations which
    // will precede the rational configuration.
  ],
  override: [
    // ESLint configuration or (nested) array of configurations which
    // will follow the rational configuration.
  ],
});
5.0.11

5 days ago

5.0.12

3 days ago

5.0.10

11 days ago

5.0.9

1 month ago

5.0.8

1 month ago

5.0.7

1 month ago

5.0.6

1 month ago

5.0.5

2 months ago

5.0.4

2 months ago

5.0.3

2 months ago

5.0.2

2 months ago

5.0.1

2 months ago

5.0.0

2 months ago

4.0.5

2 months ago

4.0.4

2 months ago

4.0.1

2 months ago

4.0.0

2 months ago

4.0.3

2 months ago

4.0.2

2 months ago

3.0.15

2 months ago

3.0.12

2 months ago

3.0.13

2 months ago

3.0.14

2 months ago

3.0.11

4 months ago

3.0.10

4 months ago

3.0.9

8 months ago

3.0.8

8 months ago

3.0.4

10 months ago

3.0.3

10 months ago

3.0.2

10 months ago

3.0.1

10 months ago

3.0.7

10 months ago

3.0.6

10 months ago

3.0.5

10 months ago

3.0.0

10 months ago

3.0.0-flat-config.9

10 months ago

3.0.0-flat-config.8

10 months ago

3.0.0-flat-config.7

10 months ago

3.0.0-flat-config.6

10 months ago

3.0.0-flat-config.5

10 months ago

3.0.0-flat-config.4

10 months ago

3.0.0-flat-config.3

10 months ago

3.0.0-flat-config.2

10 months ago

3.0.0-flat-config.1

10 months ago

3.0.0-flat-config.0

10 months ago

2.1.0

10 months ago

2.0.24

10 months ago

2.0.22

12 months ago

2.0.23

12 months ago

2.0.20

12 months ago

2.0.21

12 months ago

2.0.15

1 year ago

2.0.16

1 year ago

2.0.13

1 year ago

2.0.14

1 year ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.19

1 year ago

2.0.17

1 year ago

2.0.18

1 year ago

2.0.9

1 year ago

2.0.10

1 year ago

2.0.7

1 year ago

2.0.6

2 years ago

2.0.8

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.10

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.16

2 years ago

0.1.8

2 years ago

0.1.17

2 years ago

0.1.18

2 years ago

0.1.19

2 years ago

0.1.9

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

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