@viclafouch/eslint-config-viclafouch 4.19.0 → 4.21.0
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/package.json +1 -1
- package/rules/node.mjs +5 -2
- package/rules/react.mjs +5 -1
- package/rules/typescript.mjs +31 -3
package/package.json
CHANGED
package/rules/node.mjs
CHANGED
|
@@ -9,12 +9,15 @@ export default {
|
|
|
9
9
|
languageOptions: {
|
|
10
10
|
globals: {
|
|
11
11
|
...globals.node,
|
|
12
|
-
...globals.
|
|
12
|
+
...globals.vitest
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
rules: {
|
|
16
16
|
// Require all requires be top-level
|
|
17
17
|
// https://eslint.org/docs/rules/global-require
|
|
18
|
-
'global-require': 'error'
|
|
18
|
+
'global-require': 'error',
|
|
19
|
+
|
|
20
|
+
// Enforce usage of the `node:` prefix for builtin imports
|
|
21
|
+
'node/prefer-node-protocol': 'error'
|
|
19
22
|
}
|
|
20
23
|
}
|
package/rules/react.mjs
CHANGED
|
@@ -408,6 +408,10 @@ export default [
|
|
|
408
408
|
{
|
|
409
409
|
// Enable eslint-plugin-testing-library rules or preset only for matching files!
|
|
410
410
|
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
411
|
-
...testingLibrary.configs['flat/react']
|
|
411
|
+
...testingLibrary.configs['flat/react'],
|
|
412
|
+
rules: {
|
|
413
|
+
...testingLibrary.configs['flat/react'].rules,
|
|
414
|
+
'testing-library/render-result-naming-convention': 0
|
|
415
|
+
}
|
|
412
416
|
}
|
|
413
417
|
]
|
package/rules/typescript.mjs
CHANGED
|
@@ -107,8 +107,14 @@ export default tseslint.config(
|
|
|
107
107
|
'@typescript-eslint/naming-convention': [
|
|
108
108
|
'error',
|
|
109
109
|
{
|
|
110
|
-
selector: '
|
|
111
|
-
format: ['PascalCase']
|
|
110
|
+
selector: 'typeParameter',
|
|
111
|
+
format: ['PascalCase'],
|
|
112
|
+
leadingUnderscore: 'forbid',
|
|
113
|
+
trailingUnderscore: 'forbid',
|
|
114
|
+
custom: {
|
|
115
|
+
regex: '^(T|T[A-Z][A-Za-z]+)$',
|
|
116
|
+
match: true
|
|
117
|
+
}
|
|
112
118
|
}
|
|
113
119
|
],
|
|
114
120
|
|
|
@@ -146,7 +152,29 @@ export default tseslint.config(
|
|
|
146
152
|
|
|
147
153
|
// Disallow using the spread operator when it might cause unexpected behavior.
|
|
148
154
|
// https://typescript-eslint.io/rules/no-misused-spread/
|
|
149
|
-
'@typescript-eslint/no-misused-spread': 'error'
|
|
155
|
+
'@typescript-eslint/no-misused-spread': 'error',
|
|
156
|
+
|
|
157
|
+
// Enforce import type { T }
|
|
158
|
+
// https://typescript-eslint.io/rules/consistent-type-imports
|
|
159
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
160
|
+
'error',
|
|
161
|
+
{ prefer: 'type-imports' }
|
|
162
|
+
],
|
|
163
|
+
|
|
164
|
+
// Don't over-define types for simple things like strings
|
|
165
|
+
// https://typescript-eslint.io/rules/no-inferrable-types
|
|
166
|
+
'@typescript-eslint/no-inferrable-types': [
|
|
167
|
+
'error',
|
|
168
|
+
{ ignoreParameters: true }
|
|
169
|
+
],
|
|
170
|
+
|
|
171
|
+
// Disallow TypeScript namespaces
|
|
172
|
+
// https://typescript-eslint.io/rules/no-namespace
|
|
173
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
174
|
+
|
|
175
|
+
// Disallow non-null assertions after an optional chain expression
|
|
176
|
+
// https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
|
|
177
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error'
|
|
150
178
|
|
|
151
179
|
// Prefer using nullish coalescing (??) over logical (||) when possible.
|
|
152
180
|
// '@typescript-eslint/prefer-nullish-coalescing': 'error'
|