@zalib/linter 2.0.2 → 2.0.3

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/README.md CHANGED
@@ -14,8 +14,9 @@ module.exports = defineConfig([
14
14
  {
15
15
  ignores: ['**/node_modules/**', '**/dist/**'],
16
16
  },
17
- require('@zalib/linter/eslint/node')(),
18
- require('@zalib/linter/eslint/node-ts')(), // если нужен
17
+ ...require('@zalib/linter/eslint/node')(),
18
+ ...require('@zalib/linter/eslint/node-ts')(), // если нужен
19
+ ...require('@zalib/linter/eslint/nestjs')(), // если нужен
19
20
  ]);
20
21
  ```
21
22
 
@@ -27,16 +28,18 @@ module.exports = defineConfig([
27
28
  {
28
29
  ignores: ['**/node_modules/**', '**/dist/**'],
29
30
  },
30
- require('@zalib/linter/eslint/node')({
31
+ ...require('@zalib/linter/eslint/node')({
31
32
  files: ['src/**/*.js', 'src/**/*.ts'] // или просто ['src/**/*.js']
32
33
  }),
33
- require('@zalib/linter/eslint/node-ts')({
34
+ ...require('@zalib/linter/eslint/node-ts')({
34
35
  files: ['src/**/*.ts', 'examples/**/*.ts'],
35
36
  tsconfig: './tsconfig.dev.json'
36
37
  }),
37
38
  ]);
38
39
  ```
39
40
 
41
+ **Внимание!** Встроенные наборы правил экспортируются в виде массивов, поэтому нужно использовать спред синтаксис.
42
+
40
43
  ### prettier
41
44
  Добавить в **package.json** в корневую секцию:
42
45
  ```
package/eslint/nestjs.js CHANGED
@@ -1,11 +1,26 @@
1
1
  const nestjsPlugin = require('./plugin-nestjs');
2
2
 
3
- module.exports = ({ files } = {}) => ({
4
- files: files || ['**/*.controller.ts'],
5
- plugins: {
6
- nestjs: nestjsPlugin,
3
+ module.exports = ({ files } = {}) => [
4
+ {
5
+ files: files || ['**/*.controller.ts'],
6
+ plugins: {
7
+ nestjs: nestjsPlugin,
8
+ },
9
+ rules: {
10
+ '@typescript-eslint/no-restricted-imports': [
11
+ 'error',
12
+ {
13
+ paths: [
14
+ {
15
+ allowTypeImports: true,
16
+ importNames: ['Controller'],
17
+ message: 'Use @ApiController decorator',
18
+ name: '@nestjs/common',
19
+ },
20
+ ],
21
+ },
22
+ ],
23
+ 'nestjs/api-response': 'error',
24
+ },
7
25
  },
8
- rules: {
9
- 'nestjs/api-response': 'error',
10
- },
11
- });
26
+ ];
package/eslint/node-ts.js CHANGED
@@ -35,42 +35,40 @@ function eslintMembersGroup(suffix) {
35
35
  ];
36
36
  }
37
37
 
38
- module.exports = ({ files, tsconfig } = {}) => ({
39
- files: files || ['**/*.ts'],
40
- languageOptions: {
41
- parser: tsParser,
42
- parserOptions: {
43
- ecmaFeatures: { modules: true },
44
- project: tsconfig || './tsconfig.json',
45
- sourceType: 'module',
46
- },
47
- },
48
- plugins: {
49
- '@typescript-eslint': tsEslintPlugin,
50
- 'simple-import-sort': tsImportSortPlugin,
51
- 'typescript-sort': tsSortPlugin,
52
- import: tsImportPlugin,
53
- },
54
- settings: {
55
- 'import/resolver': {
56
- typescript: {
38
+ module.exports = ({ files, tsconfig } = {}) => [
39
+ {
40
+ files: files || ['**/*.ts'],
41
+ languageOptions: {
42
+ parser: tsParser,
43
+ parserOptions: {
44
+ ecmaFeatures: { modules: true },
57
45
  project: tsconfig || './tsconfig.json',
46
+ sourceType: 'module',
58
47
  },
59
48
  },
60
- },
61
- rules: {
62
- ...tsEslintPlugin.configs.recommended.rules,
63
- ...tsEslintPlugin.configs['recommended-requiring-type-checking'].rules,
64
- ...tsImportPlugin.configs.errors.rules,
65
- ...tsImportPlugin.configs.warnings.rules,
66
- ...tsImportPlugin.configs.typescript.rules,
67
-
68
- 'import/no-unresolved': 'error',
69
- 'import/extensions': ['error', 'ignorePackages', { ts: 'never' }],
49
+ plugins: {
50
+ '@typescript-eslint': tsEslintPlugin,
51
+ 'simple-import-sort': tsImportSortPlugin,
52
+ 'typescript-sort': tsSortPlugin,
53
+ import: tsImportPlugin,
54
+ },
55
+ settings: {
56
+ 'import/resolver': {
57
+ typescript: {
58
+ project: tsconfig || './tsconfig.json',
59
+ },
60
+ },
61
+ },
62
+ rules: {
63
+ ...tsEslintPlugin.configs.recommended.rules,
64
+ ...tsEslintPlugin.configs['recommended-requiring-type-checking'].rules,
65
+ ...tsImportPlugin.configs.errors.rules,
66
+ ...tsImportPlugin.configs.warnings.rules,
67
+ ...tsImportPlugin.configs.typescript.rules,
70
68
 
71
- '@typescript-eslint/await-thenable': 'warn',
72
- '@typescript-eslint/brace-style': 'off',
73
- /*
69
+ '@typescript-eslint/await-thenable': 'warn',
70
+ '@typescript-eslint/brace-style': 'off',
71
+ /*
74
72
  '@typescript-eslint/comma-dangle': [
75
73
  2,
76
74
  {
@@ -85,204 +83,207 @@ module.exports = ({ files, tsconfig } = {}) => ({
85
83
  },
86
84
  ],
87
85
  */
88
- '@typescript-eslint/explicit-function-return-type': [
89
- 'error',
90
- {
91
- allowExpressions: true,
92
- },
93
- ],
94
- '@typescript-eslint/explicit-member-accessibility': [
95
- 'error',
96
- {
97
- accessibility: 'explicit',
98
- overrides: {
99
- constructors: 'no-public',
86
+ '@typescript-eslint/explicit-function-return-type': [
87
+ 'error',
88
+ {
89
+ allowExpressions: true,
100
90
  },
101
- },
102
- ],
103
- '@typescript-eslint/explicit-module-boundary-types': 'error',
104
- '@typescript-eslint/indent': 'off',
105
- '@typescript-eslint/member-ordering': [
106
- 'error',
107
- {
108
- default: [
109
- // Index signature
110
- 'signature',
111
- 'call-signature',
91
+ ],
92
+ '@typescript-eslint/explicit-member-accessibility': [
93
+ 'error',
94
+ {
95
+ accessibility: 'explicit',
96
+ overrides: {
97
+ constructors: 'no-public',
98
+ },
99
+ },
100
+ ],
101
+ '@typescript-eslint/explicit-module-boundary-types': 'error',
102
+ '@typescript-eslint/indent': 'off',
103
+ '@typescript-eslint/member-ordering': [
104
+ 'error',
105
+ {
106
+ default: [
107
+ // Index signature
108
+ 'signature',
109
+ 'call-signature',
112
110
 
113
- // Fields
114
- ...eslintMembersGroup('field'),
111
+ // Fields
112
+ ...eslintMembersGroup('field'),
115
113
 
116
- // Static initialization
117
- 'static-initialization',
114
+ // Static initialization
115
+ 'static-initialization',
118
116
 
119
- // Constructors
120
- 'public-constructor',
121
- 'protected-constructor',
122
- 'private-constructor',
117
+ // Constructors
118
+ 'public-constructor',
119
+ 'protected-constructor',
120
+ 'private-constructor',
123
121
 
124
- 'constructor',
122
+ 'constructor',
125
123
 
126
- // Getters
127
- ...eslintMembersGroup('get'),
124
+ // Getters
125
+ ...eslintMembersGroup('get'),
128
126
 
129
- // Setters
130
- ...eslintMembersGroup('set'),
127
+ // Setters
128
+ ...eslintMembersGroup('set'),
131
129
 
132
- // Methods
133
- ...eslintMembersGroup('method'),
134
- ],
135
- },
136
- ],
137
- '@typescript-eslint/naming-convention': [
138
- 'error',
139
- {
140
- format: ['camelCase'],
141
- leadingUnderscore: 'forbid',
142
- selector: 'default',
143
- trailingUnderscore: 'forbid',
144
- },
145
- {
146
- format: null,
147
- modifiers: ['requiresQuotes'],
148
- selector: [
149
- 'accessor',
150
- 'classMethod',
151
- 'classProperty',
152
- 'enumMember',
153
- 'objectLiteralMethod',
154
- 'objectLiteralProperty',
155
- 'typeMethod',
156
- 'typeProperty',
157
- ],
158
- },
159
- {
160
- format: null,
161
- modifiers: ['destructured', 'unused'],
162
- selector: 'variable',
163
- },
164
- {
165
- format: ['camelCase', 'UPPER_CASE'],
166
- leadingUnderscore: 'forbid',
167
- selector: 'variable',
168
- trailingUnderscore: 'forbid',
169
- },
170
- {
171
- format: ['camelCase', 'snake_case'],
172
- leadingUnderscore: 'forbid',
173
- selector: 'property',
174
- trailingUnderscore: 'forbid',
175
- },
176
- {
177
- format: ['camelCase'],
178
- leadingUnderscore: 'allow',
179
- selector: 'parameter',
180
- trailingUnderscore: 'forbid',
181
- },
182
- {
183
- format: ['PascalCase'],
184
- leadingUnderscore: 'forbid',
185
- selector: 'typeLike',
186
- trailingUnderscore: 'forbid',
187
- },
188
- {
189
- format: ['PascalCase', 'UPPER_CASE'],
190
- leadingUnderscore: 'forbid',
191
- selector: 'enum',
192
- trailingUnderscore: 'forbid',
193
- },
194
- {
195
- format: ['PascalCase', 'UPPER_CASE'],
196
- leadingUnderscore: 'forbid',
197
- selector: 'enumMember',
198
- trailingUnderscore: 'forbid',
199
- },
200
- ],
201
- '@typescript-eslint/no-base-to-string': 'off',
202
- '@typescript-eslint/no-empty-function': [
203
- 'error',
204
- {
205
- allow: [
206
- 'constructors',
207
- 'private-constructors',
208
- 'protected-constructors',
209
- 'decoratedFunctions',
210
- 'overrideMethods',
211
- 'setters',
212
- ],
213
- },
214
- ],
215
- '@typescript-eslint/no-explicit-any': 'error',
216
- '@typescript-eslint/no-floating-promises': 'off',
217
- '@typescript-eslint/no-magic-numbers': [
218
- 'warn',
219
- {
220
- ignore: [-1, 0, 1],
221
- ignoreArrayIndexes: true,
222
- ignoreDefaultValues: true,
223
- ignoreEnums: true,
224
- ignoreNumericLiteralTypes: true,
225
- ignoreReadonlyClassProperties: true,
226
- },
227
- ],
228
- '@typescript-eslint/no-misused-promises': 'off',
229
- '@typescript-eslint/no-unsafe-argument': 'off',
230
- '@typescript-eslint/no-unsafe-assignment': 'off',
231
- '@typescript-eslint/no-unsafe-call': 'off',
232
- '@typescript-eslint/no-unsafe-member-access': 'off',
233
- '@typescript-eslint/no-unsafe-return': 'off',
234
- '@typescript-eslint/require-await': 'warn',
235
- '@typescript-eslint/restrict-template-expressions': [
236
- 'error',
237
- {
238
- allowAny: true,
239
- allowBoolean: true,
240
- allowNullish: true,
241
- allowNumber: true,
242
- },
243
- ],
244
- '@typescript-eslint/return-await': ['error', 'in-try-catch'],
245
- 'import/default': 'error',
246
- 'import/export': 'error',
247
- 'import/first': 'error',
248
- 'import/named': 'error',
249
- 'import/namespace': 'error',
250
- 'import/newline-after-import': 'error',
251
- 'import/no-cycle': 'error',
252
- 'import/no-extraneous-dependencies': [
253
- 'error',
254
- {
255
- devDependencies: true,
256
- },
257
- ],
258
- 'import/order': 'off',
259
- 'import/prefer-default-export': 'off',
260
- 'max-classes-per-file': 'off',
261
- 'simple-import-sort/imports': [
262
- 'error',
263
- {
264
- groups: [
265
- // Side effect imports.
266
- ['^\\u0000'],
267
- // Packages.
268
- // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
269
- ['^@?\\w'],
270
- // Absolute imports and other imports such as Vue-style `@/foo`.
271
- // Anything not matched in another group.
272
- ['^'],
273
- // Relative imports.
274
- // Anything that starts with a dot.
275
- ['^\\.'],
276
- // Interfaces, typings
277
- ['^\\..*(\\/|\\.)(interface|types$|typings$)'],
278
- // Constants
279
- ['^\\..*(\\/|\\.)(constant|config)'],
280
- ],
281
- },
282
- ],
283
- 'sort-imports': 'off',
284
- 'typescript-sort/interface': 'error',
285
- 'typescript-sort/type': 'error',
286
- 'typescript-sort/enum': 'error',
130
+ // Methods
131
+ ...eslintMembersGroup('method'),
132
+ ],
133
+ },
134
+ ],
135
+ '@typescript-eslint/naming-convention': [
136
+ 'error',
137
+ {
138
+ format: ['camelCase'],
139
+ leadingUnderscore: 'forbid',
140
+ selector: 'default',
141
+ trailingUnderscore: 'forbid',
142
+ },
143
+ {
144
+ format: null,
145
+ modifiers: ['requiresQuotes'],
146
+ selector: [
147
+ 'accessor',
148
+ 'classMethod',
149
+ 'classProperty',
150
+ 'enumMember',
151
+ 'objectLiteralMethod',
152
+ 'objectLiteralProperty',
153
+ 'typeMethod',
154
+ 'typeProperty',
155
+ ],
156
+ },
157
+ {
158
+ format: null,
159
+ modifiers: ['destructured', 'unused'],
160
+ selector: 'variable',
161
+ },
162
+ {
163
+ format: ['camelCase', 'UPPER_CASE'],
164
+ leadingUnderscore: 'forbid',
165
+ selector: 'variable',
166
+ trailingUnderscore: 'forbid',
167
+ },
168
+ {
169
+ format: ['camelCase', 'snake_case'],
170
+ leadingUnderscore: 'forbid',
171
+ selector: 'property',
172
+ trailingUnderscore: 'forbid',
173
+ },
174
+ {
175
+ format: ['camelCase'],
176
+ leadingUnderscore: 'allow',
177
+ selector: 'parameter',
178
+ trailingUnderscore: 'forbid',
179
+ },
180
+ {
181
+ format: ['PascalCase'],
182
+ leadingUnderscore: 'forbid',
183
+ selector: 'typeLike',
184
+ trailingUnderscore: 'forbid',
185
+ },
186
+ {
187
+ format: ['PascalCase', 'UPPER_CASE'],
188
+ leadingUnderscore: 'forbid',
189
+ selector: 'enum',
190
+ trailingUnderscore: 'forbid',
191
+ },
192
+ {
193
+ format: ['PascalCase', 'UPPER_CASE'],
194
+ leadingUnderscore: 'forbid',
195
+ selector: 'enumMember',
196
+ trailingUnderscore: 'forbid',
197
+ },
198
+ ],
199
+ '@typescript-eslint/no-base-to-string': 'off',
200
+ '@typescript-eslint/no-empty-function': [
201
+ 'error',
202
+ {
203
+ allow: [
204
+ 'constructors',
205
+ 'private-constructors',
206
+ 'protected-constructors',
207
+ 'decoratedFunctions',
208
+ 'overrideMethods',
209
+ 'setters',
210
+ ],
211
+ },
212
+ ],
213
+ '@typescript-eslint/no-explicit-any': 'error',
214
+ '@typescript-eslint/no-floating-promises': 'off',
215
+ '@typescript-eslint/no-magic-numbers': [
216
+ 'warn',
217
+ {
218
+ ignore: [-1, 0, 1],
219
+ ignoreArrayIndexes: true,
220
+ ignoreDefaultValues: true,
221
+ ignoreEnums: true,
222
+ ignoreNumericLiteralTypes: true,
223
+ ignoreReadonlyClassProperties: true,
224
+ },
225
+ ],
226
+ '@typescript-eslint/no-misused-promises': 'off',
227
+ '@typescript-eslint/no-unsafe-argument': 'off',
228
+ '@typescript-eslint/no-unsafe-assignment': 'off',
229
+ '@typescript-eslint/no-unsafe-call': 'off',
230
+ '@typescript-eslint/no-unsafe-member-access': 'off',
231
+ '@typescript-eslint/no-unsafe-return': 'off',
232
+ '@typescript-eslint/require-await': 'warn',
233
+ '@typescript-eslint/restrict-template-expressions': [
234
+ 'error',
235
+ {
236
+ allowAny: true,
237
+ allowBoolean: true,
238
+ allowNullish: true,
239
+ allowNumber: true,
240
+ },
241
+ ],
242
+ '@typescript-eslint/return-await': ['error', 'in-try-catch'],
243
+ 'import/default': 'error',
244
+ 'import/export': 'error',
245
+ 'import/extensions': ['error', 'ignorePackages', { ts: 'never' }],
246
+ 'import/first': 'error',
247
+ 'import/named': 'error',
248
+ 'import/namespace': 'error',
249
+ 'import/newline-after-import': 'error',
250
+ 'import/no-cycle': 'error',
251
+ 'import/no-extraneous-dependencies': [
252
+ 'error',
253
+ {
254
+ devDependencies: true,
255
+ },
256
+ ],
257
+ 'import/no-unresolved': 'error',
258
+ 'import/order': 'off',
259
+ 'import/prefer-default-export': 'off',
260
+ 'max-classes-per-file': 'off',
261
+ 'simple-import-sort/imports': [
262
+ 'error',
263
+ {
264
+ groups: [
265
+ // Side effect imports.
266
+ ['^\\u0000'],
267
+ // Packages.
268
+ // Things that start with a letter (or digit or underscore), or `@` followed by a letter.
269
+ ['^@?\\w'],
270
+ // Absolute imports and other imports such as Vue-style `@/foo`.
271
+ // Anything not matched in another group.
272
+ ['^'],
273
+ // Relative imports.
274
+ // Anything that starts with a dot.
275
+ ['^\\.'],
276
+ // Interfaces, typings
277
+ ['^\\..*(\\/|\\.)(interface|types$|typings$)'],
278
+ // Constants
279
+ ['^\\..*(\\/|\\.)(constant|config)'],
280
+ ],
281
+ },
282
+ ],
283
+ 'sort-imports': 'off',
284
+ 'typescript-sort/interface': 'error',
285
+ 'typescript-sort/type': 'error',
286
+ 'typescript-sort/enum': 'error',
287
+ },
287
288
  },
288
- });
289
+ ];
package/eslint/node.js CHANGED
@@ -2,91 +2,95 @@ const jestPlugin = require('eslint-plugin-jest');
2
2
  const prettierPlugin = require('eslint-plugin-prettier');
3
3
  const { isModuleInstalled } = require('./helpers');
4
4
 
5
- module.exports = ({ files } = {}) => ({
6
- files: files || ['**/*.js', '**/*.ts'],
7
- plugins: {
8
- jest: jestPlugin,
9
- prettier: prettierPlugin,
10
- },
11
- rules: {
12
- ...jestPlugin.configs.recommended.rules,
13
- ...jestPlugin.configs.style.rules,
14
- ...prettierPlugin.configs.recommended.rules,
5
+ module.exports = ({ files } = {}) => [
6
+ {
7
+ files: files || ['**/*.js', '**/*.ts'],
8
+ plugins: {
9
+ jest: jestPlugin,
10
+ prettier: prettierPlugin,
11
+ },
12
+ rules: {
13
+ ...jestPlugin.configs.recommended.rules,
14
+ ...jestPlugin.configs.style.rules,
15
+ ...prettierPlugin.configs.recommended.rules,
15
16
 
16
- 'arrow-parens': [
17
- 'warn',
18
- 'always',
19
- {
20
- requireForBlockBody: true,
21
- },
22
- ],
23
- 'class-methods-use-this': 'off',
24
- 'comma-dangle': [
25
- 'error',
26
- {
27
- arrays: 'always-multiline',
28
- exports: 'always-multiline',
29
- functions: 'always-multiline',
30
- imports: 'always-multiline',
31
- objects: 'always-multiline',
32
- },
33
- ],
34
- complexity: ['error', { max: 10 }],
35
- 'function-paren-newline': 'off',
36
- 'implicit-arrow-linebreak': 'off',
37
- 'import/extensions': 'off',
38
- 'import/no-unresolved': 'off',
39
- 'jest/no-deprecated-functions': isModuleInstalled('jest') ? 'error' : 'off',
40
- 'max-lines': [
41
- 'error',
42
- {
43
- max: 500,
44
- skipBlankLines: false,
45
- skipComments: true,
46
- },
47
- ],
48
- 'max-lines-per-function': [
49
- 'error',
50
- {
51
- max: 200,
52
- skipBlankLines: false,
53
- skipComments: true,
54
- },
55
- ],
56
- 'max-params': ['error', { max: 3 }],
57
- 'no-await-in-loop': 'off',
58
- 'no-continue': 'off',
59
- 'no-empty-function': 'off',
60
- 'no-plusplus': [
61
- 'error',
62
- {
63
- allowForLoopAfterthoughts: true,
64
- },
65
- ],
66
- 'no-promise-executor-return': 'off',
67
- 'no-restricted-syntax': 'off',
68
- 'padding-line-between-statements': [
69
- 'error',
70
- {
71
- blankLine: 'always',
72
- next: '*',
73
- prev: ['block-like'],
74
- },
75
- {
76
- blankLine: 'always',
77
- next: 'if',
78
- prev: '*',
79
- },
80
- {
81
- blankLine: 'always',
82
- next: '*',
83
- prev: 'if',
84
- },
85
- ],
86
- 'prettier/prettier': 'error',
87
- 'require-await': 'off',
88
- 'sort-imports': 'error',
89
- 'sort-keys': 'error',
90
- strict: 'off',
17
+ 'arrow-parens': [
18
+ 'warn',
19
+ 'always',
20
+ {
21
+ requireForBlockBody: true,
22
+ },
23
+ ],
24
+ 'class-methods-use-this': 'off',
25
+ 'comma-dangle': [
26
+ 'error',
27
+ {
28
+ arrays: 'always-multiline',
29
+ exports: 'always-multiline',
30
+ functions: 'always-multiline',
31
+ imports: 'always-multiline',
32
+ objects: 'always-multiline',
33
+ },
34
+ ],
35
+ complexity: ['error', { max: 10 }],
36
+ 'function-paren-newline': 'off',
37
+ 'implicit-arrow-linebreak': 'off',
38
+ 'import/extensions': 'off',
39
+ 'import/no-unresolved': 'off',
40
+ 'jest/no-deprecated-functions': isModuleInstalled('jest')
41
+ ? 'error'
42
+ : 'off',
43
+ 'max-lines': [
44
+ 'error',
45
+ {
46
+ max: 500,
47
+ skipBlankLines: false,
48
+ skipComments: true,
49
+ },
50
+ ],
51
+ 'max-lines-per-function': [
52
+ 'error',
53
+ {
54
+ max: 200,
55
+ skipBlankLines: false,
56
+ skipComments: true,
57
+ },
58
+ ],
59
+ 'max-params': ['error', { max: 3 }],
60
+ 'no-await-in-loop': 'off',
61
+ 'no-continue': 'off',
62
+ 'no-empty-function': 'off',
63
+ 'no-plusplus': [
64
+ 'error',
65
+ {
66
+ allowForLoopAfterthoughts: true,
67
+ },
68
+ ],
69
+ 'no-promise-executor-return': 'off',
70
+ 'no-restricted-syntax': 'off',
71
+ 'padding-line-between-statements': [
72
+ 'error',
73
+ {
74
+ blankLine: 'always',
75
+ next: '*',
76
+ prev: ['block-like'],
77
+ },
78
+ {
79
+ blankLine: 'always',
80
+ next: 'if',
81
+ prev: '*',
82
+ },
83
+ {
84
+ blankLine: 'always',
85
+ next: '*',
86
+ prev: 'if',
87
+ },
88
+ ],
89
+ 'prettier/prettier': 'error',
90
+ 'require-await': 'off',
91
+ 'sort-imports': 'error',
92
+ 'sort-keys': 'error',
93
+ strict: 'off',
94
+ },
91
95
  },
92
- });
96
+ ];
@@ -36,7 +36,7 @@ module.exports = {
36
36
  // рекурсивный проход по описанию типа
37
37
  function isApiResponseType(typeAnnotation, level = 0) {
38
38
  if (level === 0 && typeAnnotation?.typeName?.name === 'Promise') {
39
- const typeArgument = typeAnnotation.typeParameters?.params[0];
39
+ const typeArgument = typeAnnotation.typeArguments?.params[0];
40
40
 
41
41
  return isApiResponseType(typeArgument, level + 1);
42
42
  }
package/eslint.config.js CHANGED
@@ -2,5 +2,5 @@ const { defineConfig } = require('eslint/config');
2
2
 
3
3
  module.exports = defineConfig([
4
4
  { ignores: ['**/node_modules/**'] },
5
- require('./eslint/node')(),
5
+ ...require('./eslint/node')(),
6
6
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zalib/linter",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Linter configs",
5
5
  "author": "https://github.com/wsp-repo/",
6
6
  "license": "UNLICENSED",