@tinkoff/eslint-config 5.2.1 → 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [5.2.2](https://github.com/tramvaijs/linters/compare/v5.2.1...v5.2.2) (2026-05-12)
7
+
8
+
9
+ ### Reverts
10
+
11
+ * Revert "migrate to eslint v9" ([634f3b5](https://github.com/tramvaijs/linters/commit/634f3b5f8e88d7581efb11c700c9097846aaaa0c))
12
+
13
+
14
+
6
15
  ### [5.2.1](https://github.com/tramvaijs/linters/compare/v5.2.0...v5.2.1) (2026-04-23)
7
16
 
8
17
  **Note:** Version bump only for package @tinkoff/eslint-config
package/README.md CHANGED
@@ -1,10 +1,6 @@
1
1
  # @tinkoff/eslint-config
2
2
 
3
- ESLint config includes rules for JS and TS codebase. Better to use with framework-oriented packages `@tinkoff/eslint-config-react` or `@tinkoff/eslint-config-angular`.
4
-
5
- ## Requirements
6
-
7
- ESLint >= 9 is required.
3
+ ESlint plugin includes rules for JS and TS codebase. Better to use with framework-oriented packages `@tinkoff/eslint-config-react` or `@tinkoff/eslint-config-angular`
8
4
 
9
5
  ## Usage
10
6
 
@@ -14,60 +10,62 @@ Install from npm
14
10
  npm i --save-dev @tinkoff/eslint-config
15
11
  ```
16
12
 
17
- Create `eslint.config.js` at the project root. Package includes eslint and prettier as dependencies, so you should remove them from your project `package.json`.
13
+ Then, need to include necessary configurations sets to `.eslintrc`. Wee need to choose base configuration, and any
14
+ necessary additional configs. Package include eslint and prettier dependencies, so you should remove eslint, prettier from your project package.json because those packages are transitive dependencies.
18
15
 
19
16
  ### Base configurations
20
17
 
21
18
  #### For application
22
19
 
23
- ```js
24
- import appConfig from '@tinkoff/eslint-config/app';
25
-
26
- export default [...appConfig];
20
+ ```bash
21
+ {
22
+ "extends": ["@tinkoff/eslint-config/app"]
23
+ }
27
24
  ```
28
25
 
29
26
  #### For library
30
27
 
31
- ```js
32
- import libConfig from '@tinkoff/eslint-config/lib';
33
-
34
- export default [...libConfig];
28
+ ```bash
29
+ {
30
+ "extends": ["@tinkoff/eslint-config/lib"]
31
+ }
35
32
  ```
36
33
 
37
34
  ### Additional configurations
38
35
 
39
- #### With Jest
36
+ #### If we use Jest
40
37
 
41
- ```js
42
- import appConfig from '@tinkoff/eslint-config/app';
43
- import jestConfig from '@tinkoff/eslint-config/jest';
44
-
45
- export default [...appConfig, ...jestConfig];
38
+ ```bash
39
+ {
40
+ "extends": ["@tinkoff/eslint-config/app", "@tinkoff/eslint-config/jest"]
41
+ }
46
42
  ```
47
43
 
48
44
  ## Configurations overview
49
45
 
50
- Main configurations include common rules:
46
+ Main configurations sets contains common rules
51
47
 
52
- - `@tinkoff/eslint-config/app` common rules and specific rules for applications
53
- - `@tinkoff/eslint-config/lib` common rules and specific rules for libraries
48
+ - `@tinkoff/eslint-config/app` - common rules and specific rules for applications
49
+ - `@tinkoff/eslint-config/lib` - common rules and specific rules for libraries
54
50
 
55
- Additional configurations. These configs **do not** include common eslint rules and must be included alongside main configurations:
51
+ Additional configurations sets. This configs **not** contain common eslint rules, and must be included with main
52
+ configurations
56
53
 
57
- - `@tinkoff/eslint-config/jest` rules for linting Jest test suites
54
+ - `@tinkoff/eslint-config/jest` - rules for lint Jest test suits
58
55
 
59
56
  ## Internal used plugins
60
57
 
61
58
  `@tinkoff/eslint-config/app` and `@tinkoff/eslint-config/lib` include:
62
59
 
63
- - `eslint-config-airbnb-extended` updated version of common and popular configuration `eslint-config-airbnb`
64
- - `@eslint-community/eslint-plugin-eslint-comments` validate `eslint` comments
65
- - `eslint-plugin-import` validate proper imports
66
- - `eslint-plugin-promise` enforce best practices for promises
67
- - `eslint-plugin-jest` validate jest tests
68
- - `@typescript-eslint/eslint-plugin` lint TypeScript files, adopt many eslint rules to TS code, and provide specific TS rules
69
- - `eslint-plugin-prettier` — disable code formatting using eslint tools and transfer all the logic to prettier,
70
- and report differences as eslint issues
60
+ - `eslint-config-airbnb` - common and popular configuration
61
+ - `eslint-plugin-eslint-comments` - validate `eslint` comments
62
+ - `eslint-plugin-import` - validate proper imports
63
+ - `eslint-plugin-promise` - enforce best practices for promises
64
+ - `eslint-plugin-jest` - validate jest tests
65
+ - `@typescript-eslint/eslint-plugin` - lint TypeScript files, adopt many eslint rules to TS code, and provide specific
66
+ TS rules
67
+ - `eslint-plugin-prettier` - disable code formatting using eslint tools and transfers all the logic to a prettier, and
68
+ report differences as eslint issues
71
69
 
72
70
  ## Troubleshooting
73
71
 
@@ -82,80 +80,86 @@ then reinstall dependencies.
82
80
 
83
81
  #### In root config
84
82
 
85
- Create `eslint.config.js` at the workspace root:
83
+ 1. Add `"@tinkoff/eslint-config"` to extends section on config.
84
+ 2. Set parserOptions.project for typescript files
86
85
 
87
- ```js
88
- import appConfig from '@tinkoff/eslint-config';
86
+ ```json5
87
+ {
89
88
 
90
- export default [
91
- ...appConfig,
92
- {
93
- ignores: ['**/*'],
94
- },
95
- ];
89
+ "root": true,
90
+ "ignorePatterns": ["**/*"],
91
+ "extends": ["@tinkoff/eslint-config"]
92
+ // ...optionally some other configs
93
+ "overrides": [
94
+ {
95
+ "files": ["*.ts", "*.tsx"],
96
+ "parserOptions": {
97
+ "project": ["./tsconfig.base.json"]
98
+ }
99
+ }
100
+ ]
101
+ }
96
102
  ```
97
103
 
98
104
  #### In apps and non-buildable/non-publishable libs
99
105
 
100
- Create `eslint.config.js` in the project directory:
106
+ Add `"@tinkoff/eslint-config/app"` in extends section after root config
101
107
 
102
- ```js
103
- import rootConfig from '../../eslint.config';
104
- import appConfig from '@tinkoff/eslint-config/app';
105
-
106
- export default [
107
- ...rootConfig,
108
- ...appConfig,
109
- {
110
- files: ['**/*.ts', '**/*.tsx'],
111
- languageOptions: {
112
- parserOptions: {
113
- project: ['./tsconfig.json'],
114
- },
115
- },
116
- },
117
- ];
108
+ ```json
109
+ {
110
+ "extends": ["../../.eslintrc.json", "@tinkoff/eslint-config/app"],
111
+ "ignorePatterns": ["!**/*"]
112
+ ...optionally some other configs
113
+ }
118
114
  ```
119
115
 
120
116
  #### In buildable/publishable libs
121
117
 
122
- ```js
123
- import rootConfig from '../../eslint.config';
124
- import libConfig from '@tinkoff/eslint-config/lib';
125
-
126
- export default [
127
- ...rootConfig,
128
- ...libConfig,
129
- {
130
- files: ['**/*.ts', '**/*.tsx'],
131
- languageOptions: {
132
- parserOptions: {
133
- project: ['./tsconfig.json'],
134
- },
135
- },
136
- },
137
- ];
118
+ Add `"@tinkoff/eslint-config/lib"` in extends section after root config
119
+
120
+ ```json
121
+ {
122
+ "extends": ["../../.eslintrc.json", "@tinkoff/eslint-config/lib"],
123
+ "ignorePatterns": ["!**/*"]
124
+ ...optionally some other configs
125
+ }
138
126
  ```
139
127
 
140
- ### Disable false-positive detections from `import/no-unresolved`
128
+ ### Non-JSON configs usage
129
+
130
+ Nx means usage `.eslintrc.json` for configure ESLint. Just provide it! In `.eslintrc.json` add extension of actual root config file:
131
+
132
+ ```
133
+ {
134
+ "extends": ["./.eslintrc.js"]
135
+ }
136
+ ```
141
137
 
142
- Override the rule in the project's `eslint.config.js`:
138
+ After that:
143
139
 
144
- ```js
145
- import appConfig from '@tinkoff/eslint-config/app';
140
+ - Nx see what they need and don't re-initialize lint infrastructure
141
+ - You can use [better config formats](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#configuration-file-formats) and nx generators
146
142
 
147
- export default [
148
- ...appConfig,
149
- {
150
- files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
151
- rules: {
152
- 'import/no-unresolved': [
153
- 'error',
154
- {
155
- ignore: ['^@tinkoff/'],
156
- },
157
- ],
143
+ ### Disable false-positive detections from `import/no-unresolved`
144
+
145
+ override rule in `.eslintrc` of apps/libs that contains problem:
146
+
147
+ ```json5
148
+ {
149
+ // ...some other configs...
150
+ // disable detection for packages starts with @tinkoff/
151
+ overrides: [
152
+ {
153
+ files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
154
+ rules: {
155
+ 'import/no-unresolved': [
156
+ 'error',
157
+ {
158
+ ignore: ['^@tinkoff/'],
159
+ },
160
+ ],
161
+ },
158
162
  },
159
- },
160
- ];
163
+ ],
164
+ }
161
165
  ```
package/app.js CHANGED
@@ -1,3 +1,7 @@
1
- import index from './index.js';
1
+ module.exports = {
2
+ extends: ['./index'],
2
3
 
3
- export default [...index];
4
+ plugins: [],
5
+
6
+ rules: {},
7
+ };
package/errors/index.js CHANGED
@@ -1,17 +1,14 @@
1
- import { rules } from 'eslint-config-airbnb-extended/legacy';
2
- import typescriptParser from '@typescript-eslint/parser';
3
-
4
- export default [
5
- {
6
- files: ['**/*.js', '**/*.ts', '**/*.tsx'],
7
- languageOptions: {
8
- parser: typescriptParser,
1
+ module.exports = {
2
+ overrides: [
3
+ {
4
+ files: ['*.js', '*.ts', '*.tsx'],
5
+ parser: '@typescript-eslint/parser',
6
+ extends: ['eslint-config-airbnb-base/rules/errors'],
7
+ rules: {
8
+ // eslint-config-airbnb-base/errors
9
+ 'no-empty': ['error', { allowEmptyCatch: true }],
10
+ 'no-await-in-loop': 'off',
11
+ },
9
12
  },
10
- rules: {
11
- ...rules.base.errors.rules,
12
- // Overrides
13
- 'no-empty': ['error', { allowEmptyCatch: true }],
14
- 'no-await-in-loop': 'off',
15
- },
16
- },
17
- ];
13
+ ],
14
+ };
package/index.js CHANGED
@@ -1,26 +1,16 @@
1
- import globals from 'globals';
2
- import base from './internal/base.js';
3
- import sortClassMembers from './internal/sort-class-members.js';
4
- import importConfig from './internal/import.js';
5
- import promise from './internal/promise.js';
6
- import testFiles from './internal/test-files.js';
7
- import typescript from './internal/typescript.js';
8
- import prettier from './internal/prettier.js';
1
+ module.exports = {
2
+ extends: [
3
+ './internal/base',
4
+ './internal/sort-class-members',
5
+ './internal/import',
6
+ './internal/promise',
7
+ './internal/test-files',
8
+ './internal/typescript',
9
+ './internal/prettier',
10
+ ],
9
11
 
10
- export default [
11
- ...base,
12
- ...sortClassMembers,
13
- ...importConfig,
14
- ...promise,
15
- ...testFiles,
16
- ...typescript,
17
- ...prettier,
18
- {
19
- languageOptions: {
20
- globals: {
21
- ...globals.browser,
22
- ...globals.node,
23
- },
24
- },
12
+ env: {
13
+ browser: true,
14
+ node: true,
25
15
  },
26
- ];
16
+ };
package/internal/base.js CHANGED
@@ -1,94 +1,83 @@
1
- import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments';
2
- import babelParser from '@babel/eslint-parser';
3
- import { configs } from 'eslint-config-airbnb-extended/legacy';
4
- import errorsConfig from '../errors/index.js';
1
+ module.exports = {
2
+ extends: [
3
+ 'eslint-config-airbnb-base',
4
+ 'plugin:eslint-comments/recommended',
5
+ '../errors/index.js',
6
+ ],
5
7
 
6
- export default [
7
- ...configs.base.recommended,
8
- ...errorsConfig,
9
- {
10
- plugins: {
11
- 'eslint-comments': eslintCommentsPlugin,
8
+ parser: '@babel/eslint-parser',
9
+
10
+ settings: {
11
+ 'import/parser': '@babel/eslint-parser',
12
+ },
13
+
14
+ plugins: ['@babel'],
15
+
16
+ parserOptions: {
17
+ ecmaFeatures: {
18
+ legacyDecorators: true,
12
19
  },
13
- languageOptions: {
14
- parser: babelParser,
15
- parserOptions: {
16
- ecmaFeatures: {
17
- legacyDecorators: true,
18
- },
19
- requireConfigFile: false,
20
+ requireConfigFile: false,
21
+ },
22
+
23
+ rules: {
24
+ 'no-unused-expressions': [
25
+ 'error',
26
+ {
27
+ allowShortCircuit: true,
28
+ allowTernary: true,
20
29
  },
21
- },
22
- settings: {
23
- 'import/parser': {
24
- '@babel/eslint-parser': ['.js', '.jsx', '.ts', '.tsx'],
30
+ ],
31
+ 'no-use-before-define': [
32
+ 'error',
33
+ {
34
+ functions: false,
35
+ classes: false,
36
+ variables: true,
25
37
  },
26
- },
27
- rules: {
28
- 'eslint-comments/disable-enable-pair': 'error',
29
- 'eslint-comments/no-aggregating-enable': 'error',
30
- 'eslint-comments/no-duplicate-disable': 'error',
31
- 'eslint-comments/no-unlimited-disable': 'error',
32
- 'eslint-comments/no-unused-enable': 'error',
33
-
34
- 'no-unused-expressions': [
35
- 'error',
36
- {
37
- allowShortCircuit: true,
38
- allowTernary: true,
39
- },
40
- ],
41
- 'no-use-before-define': [
42
- 'error',
43
- {
44
- functions: false,
45
- classes: false,
46
- variables: true,
47
- },
48
- ],
49
- 'func-name-matching': 'off',
50
- 'global-require': 'off',
51
- 'class-methods-use-this': 'off',
52
- 'no-continue': 'off',
53
- 'no-restricted-syntax': 'off',
54
- 'guard-for-in': 'off',
55
- 'default-case': 'off',
56
- 'no-plusplus': 'off',
57
- 'func-names': 'off',
58
- 'consistent-return': 'warn',
59
- 'vars-on-top': 'warn',
60
- 'no-var': 'warn',
61
- camelcase: [
62
- 'warn',
63
- {
64
- allow: ['^UNSAFE_'],
65
- ignoreDestructuring: false,
66
- properties: 'never',
67
- },
68
- ],
69
- 'func-style': [
70
- 'error',
71
- 'declaration',
72
- {
73
- allowArrowFunctions: true,
74
- },
75
- ],
76
- 'max-depth': 'off',
77
- 'max-params': 'off',
78
- 'max-classes-per-file': ['error', 4],
79
- complexity: ['error', 25],
80
- 'max-statements': ['error', 25],
81
- 'no-underscore-dangle': 'off',
82
- 'no-return-assign': ['error', 'except-parens'],
83
- 'lines-between-class-members': [
84
- 'error',
85
- 'always',
86
- { exceptAfterSingleLine: true },
87
- ],
88
- 'spaced-comment': ['error', 'always', { exceptions: ['*'] }],
89
- 'max-nested-callbacks': ['error', 4],
90
- 'no-bitwise': 'warn',
91
- 'no-useless-escape': 'warn',
92
- },
38
+ ],
39
+ 'func-name-matching': 'off',
40
+ 'global-require': 'off',
41
+ 'class-methods-use-this': 'off',
42
+ 'no-continue': 'off',
43
+ 'no-restricted-syntax': 'off',
44
+ 'guard-for-in': 'off',
45
+ 'default-case': 'off',
46
+ 'no-plusplus': 'off',
47
+ 'func-names': 'off',
48
+ 'consistent-return': 'warn',
49
+ 'vars-on-top': 'warn',
50
+ 'no-var': 'warn',
51
+ camelcase: [
52
+ 'warn',
53
+ {
54
+ allow: ['^UNSAFE_'],
55
+ ignoreDestructuring: false,
56
+ properties: 'never',
57
+ },
58
+ ],
59
+ 'func-style': [
60
+ 'error',
61
+ 'declaration',
62
+ {
63
+ allowArrowFunctions: true,
64
+ },
65
+ ],
66
+ 'max-depth': 'off',
67
+ 'max-params': 'off',
68
+ 'max-classes-per-file': ['error', 4],
69
+ complexity: ['error', 25],
70
+ 'max-statements': ['error', 25],
71
+ 'no-underscore-dangle': 'off',
72
+ 'no-return-assign': ['error', 'except-parens'],
73
+ 'lines-between-class-members': [
74
+ 'error',
75
+ 'always',
76
+ { exceptAfterSingleLine: true },
77
+ ],
78
+ 'spaced-comment': ['error', 'always', { exceptions: ['*'] }],
79
+ 'max-nested-callbacks': ['error', 4],
80
+ 'no-bitwise': 'warn',
81
+ 'no-useless-escape': 'warn',
93
82
  },
94
- ];
83
+ };
@@ -1,45 +1,36 @@
1
- import importPlugin from 'eslint-plugin-import';
1
+ module.exports = {
2
+ plugins: ['import'],
2
3
 
3
- export default [
4
- {
5
- plugins: {
6
- import: importPlugin,
7
- },
8
-
9
- settings: {
10
- 'import/resolver': {
11
- node: {
12
- extensions: ['.js', '.mjs', '.cjs', '.ts'],
13
- },
14
- typescript: {},
15
- webpack: {},
4
+ settings: {
5
+ 'import/resolver': {
6
+ node: {
7
+ extensions: ['.js', '.mjs', '.cjs', '.ts'],
16
8
  },
9
+ typescript: {},
10
+ webpack: {},
17
11
  },
12
+ },
18
13
 
19
- rules: {
20
- 'import/no-commonjs': 'off',
21
- 'import/unambiguous': 'off',
22
- 'import/prefer-default-export': 'off', // default imports is evil
23
- 'import/no-deprecated': 'warn',
24
- 'import/default': 'error', // enable default import validation
25
- 'import/extensions': [
26
- 'error',
27
- 'always',
28
- {
29
- js: 'never',
30
- mjs: 'never',
31
- cjs: 'never',
32
- jsx: 'never',
33
- ts: 'never',
34
- tsx: 'never',
35
- },
36
- ],
37
- 'import/order': [
38
- 'warn',
39
- { groups: [['builtin', 'external', 'internal']] },
40
- ],
41
- 'import/no-extraneous-dependencies': 'off', // need fine tuning
42
- 'import/no-cycle': 'error',
43
- },
14
+ rules: {
15
+ 'import/no-commonjs': 'off',
16
+ 'import/unambiguous': 'off',
17
+ 'import/prefer-default-export': 'off', // default imports is evil
18
+ 'import/no-deprecated': 'warn',
19
+ 'import/default': 'error', // enable default import validation
20
+ 'import/extensions': [
21
+ 'error',
22
+ 'always',
23
+ {
24
+ js: 'never',
25
+ mjs: 'never',
26
+ cjs: 'never',
27
+ jsx: 'never',
28
+ ts: 'never',
29
+ tsx: 'never',
30
+ },
31
+ ],
32
+ 'import/order': ['warn', { groups: [['builtin', 'external', 'internal']] }],
33
+ 'import/no-extraneous-dependencies': 'off', // need fine tuning
34
+ 'import/no-cycle': 'error',
44
35
  },
45
- ];
36
+ };
@@ -1,16 +1,3 @@
1
- import prettierPlugin from 'eslint-plugin-prettier';
2
- import prettierConfig from 'eslint-config-prettier';
3
-
4
- export default [
5
- {
6
- plugins: {
7
- prettier: prettierPlugin,
8
- },
9
- rules: {
10
- ...prettierConfig.rules,
11
- 'prettier/prettier': 'error',
12
- 'arrow-body-style': 'off',
13
- 'prefer-arrow-callback': 'off',
14
- },
15
- },
16
- ];
1
+ module.exports = {
2
+ extends: ['plugin:prettier/recommended'],
3
+ };
@@ -1,13 +1,10 @@
1
- import promisePlugin from 'eslint-plugin-promise';
1
+ module.exports = {
2
+ extends: ['plugin:promise/recommended'],
2
3
 
3
- export default [
4
- promisePlugin.configs['flat/recommended'],
5
- {
6
- rules: {
7
- 'promise/always-return': 'off',
8
- 'promise/no-callback-in-promise': 'off',
9
- 'promise/catch-or-return': 'warn',
10
- 'promise/param-names': 'warn',
11
- },
4
+ rules: {
5
+ 'promise/always-return': 'off',
6
+ 'promise/no-callback-in-promise': 'off',
7
+ 'promise/catch-or-return': 'warn',
8
+ 'promise/param-names': 'warn',
12
9
  },
13
- ];
10
+ };