@viclafouch/eslint-config-viclafouch 4.20.0 → 4.21.1-beta.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/index.mjs +10 -0
- package/package.json +7 -6
- package/reset.d.ts +0 -5
- package/rules/node.mjs +5 -2
- package/rules/typescript.mjs +31 -3
package/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
|
|
2
|
+
import globals from 'globals'
|
|
1
3
|
import bestPracticesConfig from './rules/best-practices.mjs'
|
|
2
4
|
import errorConfig from './rules/errors.mjs'
|
|
3
5
|
import es6Config from './rules/es6.mjs'
|
|
@@ -16,6 +18,14 @@ export default [
|
|
|
16
18
|
reportUnusedDisableDirectives: 'error'
|
|
17
19
|
}
|
|
18
20
|
},
|
|
21
|
+
{
|
|
22
|
+
languageOptions: {
|
|
23
|
+
globals: globals.builtin
|
|
24
|
+
},
|
|
25
|
+
plugins: {
|
|
26
|
+
unicorn: eslintPluginUnicorn
|
|
27
|
+
}
|
|
28
|
+
},
|
|
19
29
|
bestPracticesConfig,
|
|
20
30
|
nodeConfig,
|
|
21
31
|
errorConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viclafouch/eslint-config-viclafouch",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.21.1-beta.0",
|
|
4
4
|
"description": "ESLint and Prettier Config from Victor de la Fouchardiere",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/core": "^7.26.9",
|
|
34
34
|
"@babel/eslint-parser": "^7.26.8",
|
|
35
|
+
"@eslint/js": "^9.21.0",
|
|
35
36
|
"@next/eslint-plugin-next": "^15.2.1",
|
|
36
37
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
37
38
|
"app-root-path": "^3.1.0",
|
|
@@ -48,11 +49,10 @@
|
|
|
48
49
|
"get-tsconfig": "^4.10.0",
|
|
49
50
|
"globals": "^16.0.0",
|
|
50
51
|
"prettier": ">= 3",
|
|
51
|
-
"typescript-eslint": "^8.26.0",
|
|
52
|
-
"@eslint/js": "^9.21.0",
|
|
53
52
|
"prettier-plugin-curly": "^0.3.1",
|
|
54
|
-
"
|
|
55
|
-
"typescript": "
|
|
53
|
+
"typescript": ">= 5",
|
|
54
|
+
"typescript-eslint": "^8.26.0",
|
|
55
|
+
"eslint": ">= 9"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"lint": "eslint .",
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"publish:beta": "npm publish --tag beta"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"eslint": "^9.
|
|
66
|
+
"eslint": "^9.24.0",
|
|
67
|
+
"eslint-plugin-unicorn": "^58.0.0",
|
|
67
68
|
"typescript": "^5.7.2"
|
|
68
69
|
}
|
|
69
70
|
}
|
package/reset.d.ts
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
|
+
'unicorn/prefer-node-protocol': 'error'
|
|
19
22
|
}
|
|
20
23
|
}
|
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'
|