@abinnovision/eslint-config-base 3.4.1 → 3.4.2-beta.1
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/dist/configs/base.cjs +440 -4
- package/dist/configs/base.d.cts +1 -3
- package/dist/configs/base.d.mts +1 -3
- package/dist/configs/base.mjs +436 -0
- package/dist/configs/flavour-config-files.cjs +25 -1
- package/dist/configs/flavour-config-files.d.cts +1 -3
- package/dist/configs/flavour-config-files.d.mts +1 -3
- package/dist/configs/flavour-config-files.mjs +24 -0
- package/dist/configs/flavour-nestjs.cjs +24 -1
- package/dist/configs/flavour-nestjs.d.cts +1 -3
- package/dist/configs/flavour-nestjs.d.mts +1 -3
- package/dist/configs/flavour-nestjs.mjs +24 -0
- package/dist/configs/flavour-stylistic.cjs +45 -1
- package/dist/configs/flavour-stylistic.d.cts +1 -3
- package/dist/configs/flavour-stylistic.d.mts +1 -3
- package/dist/configs/flavour-stylistic.mjs +44 -0
- package/dist/configs/flavour-vitest.cjs +170 -1
- package/dist/configs/flavour-vitest.d.cts +1 -3
- package/dist/configs/flavour-vitest.d.mts +1 -3
- package/dist/configs/flavour-vitest.mjs +169 -0
- package/dist/configs/index.cjs +10 -5
- package/dist/configs/index.mjs +6 -6
- package/package.json +23 -10
- package/dist/configs/index.d.mts +0 -5
|
@@ -21,34 +21,203 @@ const config = defineConfig([{
|
|
|
21
21
|
languageOptions: { globals: { ...vitest.environments.env.globals } },
|
|
22
22
|
settings: { vitest: { typecheck: true } },
|
|
23
23
|
rules: {
|
|
24
|
+
/**
|
|
25
|
+
* Enable Vitest recommended rules.
|
|
26
|
+
*/
|
|
24
27
|
...vitest.configs.recommended.rules,
|
|
28
|
+
/**
|
|
29
|
+
* Enforce a maximum number of parameters in function definitions.
|
|
30
|
+
* Increased to 5 for test setup functions that receive fixtures and mocks.
|
|
31
|
+
*
|
|
32
|
+
* @see https://eslint.org/docs/latest/rules/max-params
|
|
33
|
+
*/
|
|
25
34
|
"max-params": ["error", 5],
|
|
35
|
+
/**
|
|
36
|
+
* Enforce a maximum depth that callbacks can be nested.
|
|
37
|
+
* Increased to 5 for describe/it/beforeEach nesting patterns.
|
|
38
|
+
*
|
|
39
|
+
* @see https://eslint.org/docs/latest/rules/max-nested-callbacks
|
|
40
|
+
*/
|
|
26
41
|
"max-nested-callbacks": ["error", 5],
|
|
42
|
+
/**
|
|
43
|
+
* Enforce a maximum cyclomatic complexity allowed in a program.
|
|
44
|
+
* Increased to 30 and downgraded to warn for complex test scenarios.
|
|
45
|
+
*
|
|
46
|
+
* @see https://eslint.org/docs/latest/rules/complexity
|
|
47
|
+
*/
|
|
27
48
|
complexity: ["warn", 30],
|
|
49
|
+
/**
|
|
50
|
+
* Enforce a maximum number of lines per function.
|
|
51
|
+
* Disabled for test cases with comprehensive setup and assertions.
|
|
52
|
+
*
|
|
53
|
+
* @see https://eslint.org/docs/latest/rules/max-lines-per-function
|
|
54
|
+
*/
|
|
28
55
|
"max-lines-per-function": "off",
|
|
56
|
+
/**
|
|
57
|
+
* Enforce a maximum number of statements allowed in function blocks.
|
|
58
|
+
* Disabled for tests with multiple setup and assertion statements.
|
|
59
|
+
*
|
|
60
|
+
* @see https://eslint.org/docs/latest/rules/max-statements
|
|
61
|
+
*/
|
|
29
62
|
"max-statements": "off",
|
|
63
|
+
/**
|
|
64
|
+
* Enforce a maximum number of lines per file.
|
|
65
|
+
* Disabled for comprehensive test suites.
|
|
66
|
+
*
|
|
67
|
+
* @see https://eslint.org/docs/latest/rules/max-lines
|
|
68
|
+
*/
|
|
30
69
|
"max-lines": "off",
|
|
70
|
+
/**
|
|
71
|
+
* Disallow assigning a value with type any to variables and properties.
|
|
72
|
+
* Disabled for mock objects and test utilities.
|
|
73
|
+
*
|
|
74
|
+
* @see https://typescript-eslint.io/rules/no-unsafe-assignment
|
|
75
|
+
*/
|
|
31
76
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
77
|
+
/**
|
|
78
|
+
* Disallow member access on a value with type any.
|
|
79
|
+
* Disabled for mock objects.
|
|
80
|
+
*
|
|
81
|
+
* @see https://typescript-eslint.io/rules/no-unsafe-member-access
|
|
82
|
+
*/
|
|
32
83
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
84
|
+
/**
|
|
85
|
+
* Disallow calling a value with type any.
|
|
86
|
+
* Disabled for test utilities like vi.fn().
|
|
87
|
+
*
|
|
88
|
+
* @see https://typescript-eslint.io/rules/no-unsafe-call
|
|
89
|
+
*/
|
|
33
90
|
"@typescript-eslint/no-unsafe-call": "off",
|
|
91
|
+
/**
|
|
92
|
+
* Disallow returning a value with type any from a function.
|
|
93
|
+
* Disabled for test helper functions.
|
|
94
|
+
*
|
|
95
|
+
* @see https://typescript-eslint.io/rules/no-unsafe-return
|
|
96
|
+
*/
|
|
34
97
|
"@typescript-eslint/no-unsafe-return": "off",
|
|
98
|
+
/**
|
|
99
|
+
* Disallow passing a value with type any to a function parameter.
|
|
100
|
+
* Disabled for test mock parameters.
|
|
101
|
+
*
|
|
102
|
+
* @see https://typescript-eslint.io/rules/no-unsafe-argument
|
|
103
|
+
*/
|
|
35
104
|
"@typescript-eslint/no-unsafe-argument": "off",
|
|
105
|
+
/**
|
|
106
|
+
* Require unbound methods to be called with correct this context.
|
|
107
|
+
* Disabled for Vitest expectations like expect(obj.method).toBeCalled().
|
|
108
|
+
*
|
|
109
|
+
* @see https://typescript-eslint.io/rules/unbound-method
|
|
110
|
+
*/
|
|
36
111
|
"@typescript-eslint/unbound-method": "off",
|
|
112
|
+
/**
|
|
113
|
+
* Disallow magic numbers.
|
|
114
|
+
* Disabled for test assertions with literal values.
|
|
115
|
+
*
|
|
116
|
+
* @see https://typescript-eslint.io/rules/no-magic-numbers
|
|
117
|
+
*/
|
|
37
118
|
"@typescript-eslint/no-magic-numbers": "off",
|
|
119
|
+
/**
|
|
120
|
+
* Require Promise-like statements to be handled appropriately.
|
|
121
|
+
* Downgraded to warn for test utilities.
|
|
122
|
+
*
|
|
123
|
+
* @see https://typescript-eslint.io/rules/no-floating-promises
|
|
124
|
+
*/
|
|
38
125
|
"@typescript-eslint/no-floating-promises": "warn",
|
|
126
|
+
/**
|
|
127
|
+
* Disallow non-null assertions using the ! postfix operator.
|
|
128
|
+
* Disabled for tests where values are known to exist.
|
|
129
|
+
*
|
|
130
|
+
* @see https://typescript-eslint.io/rules/no-non-null-assertion
|
|
131
|
+
*/
|
|
39
132
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
133
|
+
/**
|
|
134
|
+
* Disallow empty functions.
|
|
135
|
+
* Disabled for test stubs and spies.
|
|
136
|
+
*
|
|
137
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-function
|
|
138
|
+
*/
|
|
40
139
|
"no-empty-function": "off",
|
|
140
|
+
/**
|
|
141
|
+
* Disallow empty functions.
|
|
142
|
+
* Disabled for test stubs and spies.
|
|
143
|
+
*
|
|
144
|
+
* @see https://typescript-eslint.io/rules/no-empty-function
|
|
145
|
+
*/
|
|
41
146
|
"@typescript-eslint/no-empty-function": "off",
|
|
147
|
+
/**
|
|
148
|
+
* Disallow magic numbers.
|
|
149
|
+
* Disabled for test assertions.
|
|
150
|
+
*
|
|
151
|
+
* @see https://eslint.org/docs/latest/rules/no-magic-numbers
|
|
152
|
+
*/
|
|
42
153
|
"no-magic-numbers": "off",
|
|
154
|
+
/**
|
|
155
|
+
* Disallow the use of console.
|
|
156
|
+
* Disabled for test debugging.
|
|
157
|
+
*
|
|
158
|
+
* @see https://eslint.org/docs/latest/rules/no-console
|
|
159
|
+
*/
|
|
43
160
|
"no-console": "off",
|
|
161
|
+
/**
|
|
162
|
+
* Allow importing devDependencies in test files.
|
|
163
|
+
* Already covered by the base rule's allowlist; kept here as an explicit
|
|
164
|
+
* override for consumers that overlay this config on different file globs.
|
|
165
|
+
*
|
|
166
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
167
|
+
*/
|
|
44
168
|
"import/no-extraneous-dependencies": "off",
|
|
169
|
+
/**
|
|
170
|
+
* Disallow focused tests.
|
|
171
|
+
* Prevents .only from being committed.
|
|
172
|
+
*
|
|
173
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
|
|
174
|
+
*/
|
|
45
175
|
"vitest/no-focused-tests": "error",
|
|
176
|
+
/**
|
|
177
|
+
* Disallow disabled tests.
|
|
178
|
+
* Warns about .skip usage.
|
|
179
|
+
*
|
|
180
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
|
|
181
|
+
*/
|
|
46
182
|
"vitest/no-disabled-tests": "warn",
|
|
183
|
+
/**
|
|
184
|
+
* Enforce lowercase test names.
|
|
185
|
+
* Consistent test naming convention.
|
|
186
|
+
*
|
|
187
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
188
|
+
*/
|
|
47
189
|
"vitest/prefer-lowercase-title": "warn",
|
|
190
|
+
/**
|
|
191
|
+
* Enforce a maximum depth for nested describe calls.
|
|
192
|
+
*
|
|
193
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
|
|
194
|
+
*/
|
|
48
195
|
"vitest/max-nested-describe": ["error", { max: 5 }],
|
|
196
|
+
/**
|
|
197
|
+
* Disallow conditional logic in tests.
|
|
198
|
+
* Tests should be deterministic.
|
|
199
|
+
*
|
|
200
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
|
|
201
|
+
*/
|
|
49
202
|
"vitest/no-conditional-in-test": "error",
|
|
203
|
+
/**
|
|
204
|
+
* Disallow conditional expects.
|
|
205
|
+
* Expectations should not be inside conditionals.
|
|
206
|
+
*
|
|
207
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
|
|
208
|
+
*/
|
|
50
209
|
"vitest/no-conditional-expect": "error",
|
|
210
|
+
/**
|
|
211
|
+
* Enforce consistent hook ordering.
|
|
212
|
+
*
|
|
213
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
214
|
+
*/
|
|
51
215
|
"vitest/prefer-hooks-in-order": "warn",
|
|
216
|
+
/**
|
|
217
|
+
* Prefer vi.spyOn over manual mocks.
|
|
218
|
+
*
|
|
219
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
|
|
220
|
+
*/
|
|
52
221
|
"vitest/prefer-spy-on": "warn"
|
|
53
222
|
}
|
|
54
223
|
}]);
|
package/dist/configs/index.cjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
require("./base.cjs");
|
|
2
|
-
require("./flavour-config-files.cjs");
|
|
3
|
-
require("./flavour-nestjs.cjs");
|
|
4
|
-
require("./flavour-stylistic.cjs");
|
|
5
|
-
require("./flavour-vitest.cjs");
|
|
1
|
+
const require_base = require("./base.cjs");
|
|
2
|
+
const require_flavour_config_files = require("./flavour-config-files.cjs");
|
|
3
|
+
const require_flavour_nestjs = require("./flavour-nestjs.cjs");
|
|
4
|
+
const require_flavour_stylistic = require("./flavour-stylistic.cjs");
|
|
5
|
+
const require_flavour_vitest = require("./flavour-vitest.cjs");
|
|
6
|
+
exports.base = require_base.config;
|
|
7
|
+
exports.configFiles = require_flavour_config_files.config;
|
|
8
|
+
exports.nestjs = require_flavour_nestjs.config;
|
|
9
|
+
exports.stylistic = require_flavour_stylistic.config;
|
|
10
|
+
exports.vitest = require_flavour_vitest.config;
|
package/dist/configs/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./base.mjs";
|
|
2
|
-
import "./flavour-config-files.mjs";
|
|
3
|
-
import "./flavour-nestjs.mjs";
|
|
4
|
-
import "./flavour-stylistic.mjs";
|
|
5
|
-
import "./flavour-vitest.mjs";
|
|
6
|
-
export {};
|
|
1
|
+
import { config } from "./base.mjs";
|
|
2
|
+
import { config as config$1 } from "./flavour-config-files.mjs";
|
|
3
|
+
import { config as config$2 } from "./flavour-nestjs.mjs";
|
|
4
|
+
import { config as config$3 } from "./flavour-stylistic.mjs";
|
|
5
|
+
import { config as config$4 } from "./flavour-vitest.mjs";
|
|
6
|
+
export { config as base, config$1 as configFiles, config$2 as nestjs, config$3 as stylistic, config$4 as vitest };
|
package/package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abinnovision/eslint-config-base",
|
|
3
|
-
"version": "3.4.1",
|
|
3
|
+
"version": "3.4.2-beta.1",
|
|
4
|
+
"description": "Shared ESLint configuration for JavaScript and TypeScript projects.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eslint",
|
|
7
|
+
"eslint-config",
|
|
8
|
+
"typescript",
|
|
9
|
+
"javascript"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/abinnovision/js-commons",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/abinnovision/js-commons/issues"
|
|
14
|
+
},
|
|
4
15
|
"repository": {
|
|
5
|
-
"
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/abinnovision/js-commons.git",
|
|
18
|
+
"directory": "packages/eslint-config-base"
|
|
6
19
|
},
|
|
7
20
|
"license": "Apache-2.0",
|
|
8
21
|
"author": {
|
|
@@ -46,20 +59,20 @@
|
|
|
46
59
|
},
|
|
47
60
|
"prettier": "@abinnovision/prettier-config",
|
|
48
61
|
"dependencies": {
|
|
49
|
-
"@eslint/js": "^10.0.
|
|
62
|
+
"@eslint/js": "^10.0.1",
|
|
50
63
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
51
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
52
|
-
"eslint-plugin-import-x": "^4.
|
|
64
|
+
"@vitest/eslint-plugin": "^1.6.23",
|
|
65
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
53
66
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
54
|
-
"globals": "^17.
|
|
55
|
-
"typescript-eslint": "^8.
|
|
67
|
+
"globals": "^17.7.0",
|
|
68
|
+
"typescript-eslint": "^8.63.0"
|
|
56
69
|
},
|
|
57
70
|
"devDependencies": {
|
|
58
71
|
"@abinnovision/prettier-config": "^2.2.0",
|
|
59
72
|
"@internal/tsconfig": "^1.0.0",
|
|
60
|
-
"eslint": "^10.
|
|
61
|
-
"prettier": "^3.
|
|
62
|
-
"tsdown": "^0.
|
|
73
|
+
"eslint": "^10.7.0",
|
|
74
|
+
"prettier": "^3.9.5",
|
|
75
|
+
"tsdown": "^0.22.5",
|
|
63
76
|
"typescript": "^5.9.3"
|
|
64
77
|
},
|
|
65
78
|
"peerDependencies": {
|
package/dist/configs/index.d.mts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { config } from "./base.mjs";
|
|
2
|
-
import { config as config$1 } from "./flavour-config-files.mjs";
|
|
3
|
-
import { config as config$2 } from "./flavour-nestjs.mjs";
|
|
4
|
-
import { config as config$3 } from "./flavour-stylistic.mjs";
|
|
5
|
-
import { config as config$4 } from "./flavour-vitest.mjs";
|