@viclafouch/eslint-config-viclafouch 4.10.1-beta.1 → 4.12.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 +20 -19
- package/prettier.js +1 -0
- package/rules/react.js +6 -2
- package/rules/typescript.js +8 -11
- package/tsconfig.json +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viclafouch/eslint-config-viclafouch",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "ESLint and Prettier Config from Victor de la Fouchardiere",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -25,32 +25,33 @@
|
|
|
25
25
|
"homepage": "https://github.com/viclafouch/eslint-config-viclafouch#readme",
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"eslint": "^8.57.0",
|
|
28
|
-
"prettier": "^3.
|
|
29
|
-
"typescript": "^5.
|
|
28
|
+
"prettier": "^3.3.0",
|
|
29
|
+
"typescript": "^5.5.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/core": "^7.
|
|
33
|
-
"@babel/eslint-parser": "^7.
|
|
34
|
-
"@next/eslint-plugin-next": "^14.2.
|
|
35
|
-
"@rushstack/eslint-patch": "^1.10.
|
|
32
|
+
"@babel/core": "^7.25.2",
|
|
33
|
+
"@babel/eslint-parser": "^7.25.1",
|
|
34
|
+
"@next/eslint-plugin-next": "^14.2.5",
|
|
35
|
+
"@rushstack/eslint-patch": "^1.10.4",
|
|
36
36
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
38
|
-
"@typescript-eslint/parser": "^
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
38
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
39
39
|
"app-root-path": "^3.1.0",
|
|
40
40
|
"babel-loader": "^9.1.3",
|
|
41
41
|
"eslint": "^8.57.0",
|
|
42
42
|
"eslint-config-prettier": "^9.1.0",
|
|
43
43
|
"eslint-plugin-import": "^2.29.1",
|
|
44
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
45
|
-
"eslint-plugin-prettier": "^5.1
|
|
46
|
-
"eslint-plugin-promise": "^
|
|
47
|
-
"eslint-plugin-react": "^7.
|
|
48
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
49
|
-
"eslint-plugin-simple-import-sort": "^12.1.
|
|
50
|
-
"eslint-plugin-testing-library": "^6.2.
|
|
51
|
-
"get-tsconfig": "^4.7.
|
|
52
|
-
"prettier": "^3.
|
|
53
|
-
"typescript": "^5.4
|
|
44
|
+
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
45
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
46
|
+
"eslint-plugin-promise": "^7.0.0",
|
|
47
|
+
"eslint-plugin-react": "^7.35.0",
|
|
48
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
49
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
50
|
+
"eslint-plugin-testing-library": "^6.2.2",
|
|
51
|
+
"get-tsconfig": "^4.7.6",
|
|
52
|
+
"prettier": "^3.3.3",
|
|
53
|
+
"typescript": "^5.5.4",
|
|
54
|
+
"prettier-plugin-curly": "^0.2.2"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
57
|
"lint": "eslint .",
|
package/prettier.js
CHANGED
package/rules/react.js
CHANGED
|
@@ -325,7 +325,7 @@ module.exports = {
|
|
|
325
325
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
|
|
326
326
|
'react/function-component-definition': [
|
|
327
327
|
'error',
|
|
328
|
-
{ namedComponents: 'arrow-function' }
|
|
328
|
+
{ namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' }
|
|
329
329
|
],
|
|
330
330
|
|
|
331
331
|
// Prevent react contexts from taking non-stable values
|
|
@@ -368,7 +368,11 @@ module.exports = {
|
|
|
368
368
|
],
|
|
369
369
|
|
|
370
370
|
// Don't require captions for video / audio
|
|
371
|
-
'jsx-a11y/media-has-caption': 'off'
|
|
371
|
+
'jsx-a11y/media-has-caption': 'off',
|
|
372
|
+
|
|
373
|
+
// Disable spreading props in components more than once
|
|
374
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.35.0/docs/rules/jsx-props-no-spread-multi.md
|
|
375
|
+
'react/jsx-props-no-spread-multi': 'off'
|
|
372
376
|
},
|
|
373
377
|
overrides: [
|
|
374
378
|
{
|
package/rules/typescript.js
CHANGED
|
@@ -60,12 +60,6 @@ module.exports = {
|
|
|
60
60
|
'no-shadow': 'off',
|
|
61
61
|
'@typescript-eslint/no-shadow': baseVariablesRules['no-shadow'],
|
|
62
62
|
|
|
63
|
-
// Replace @viclafouch/eslint 'no-throw-literal' rule with '@typescript-eslint' version
|
|
64
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
|
|
65
|
-
'no-throw-literal': 'off',
|
|
66
|
-
'@typescript-eslint/no-throw-literal':
|
|
67
|
-
baseBestPracticesRules['no-throw-literal'],
|
|
68
|
-
|
|
69
63
|
// Replace @viclafouch/eslint 'no-unused-expressions' rule with '@typescript-eslint' version
|
|
70
64
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
|
|
71
65
|
'no-unused-expressions': 'off',
|
|
@@ -114,10 +108,6 @@ module.exports = {
|
|
|
114
108
|
}
|
|
115
109
|
],
|
|
116
110
|
|
|
117
|
-
// No useless template literals
|
|
118
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-template-literals.md
|
|
119
|
-
'@typescript-eslint/no-useless-template-literals': 'error',
|
|
120
|
-
|
|
121
111
|
// Require consistently using T[] instead of Array<T>
|
|
122
112
|
// https://typescript-eslint.io/rules/array-type
|
|
123
113
|
'@typescript-eslint/array-type': 'error',
|
|
@@ -140,7 +130,14 @@ module.exports = {
|
|
|
140
130
|
|
|
141
131
|
// No more "as Record<any, any>" in Array.reduce initial value, use generics
|
|
142
132
|
// https://typescript-eslint.io/rules/prefer-reduce-type-parameter
|
|
143
|
-
'@typescript-eslint/prefer-reduce-type-parameter': 'error'
|
|
133
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
|
|
134
|
+
|
|
135
|
+
// Require Promise-like statements to be handled appropriately.
|
|
136
|
+
// https://typescript-eslint.io/rules/no-floating-promises
|
|
137
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
138
|
+
|
|
139
|
+
// Prefer using nullish coalescing (??) over logical (||) when possible.
|
|
140
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'error'
|
|
144
141
|
|
|
145
142
|
// '@typescript-eslint/ban-types': [
|
|
146
143
|
// 'error',
|
package/tsconfig.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
2
3
|
"include": ["./**/*"],
|
|
3
4
|
"compilerOptions": {
|
|
4
5
|
"target": "esnext",
|
|
@@ -9,12 +10,19 @@
|
|
|
9
10
|
"forceConsistentCasingInFileNames": true,
|
|
10
11
|
"noEmit": true,
|
|
11
12
|
"esModuleInterop": true,
|
|
12
|
-
|
|
13
|
+
// External bundlers should use preserve
|
|
14
|
+
"module": "preserve",
|
|
15
|
+
// Make indexing stricter, not accessing unknown properties
|
|
13
16
|
"noUncheckedIndexedAccess": true,
|
|
14
17
|
"noPropertyAccessFromIndexSignature": false,
|
|
15
18
|
"moduleResolution": "node",
|
|
19
|
+
// No accidental global script
|
|
20
|
+
"moduleDetection": "force",
|
|
16
21
|
"resolveJsonModule": true,
|
|
22
|
+
// Force to "type-only" imports. Erase the import {} statement on runtime.
|
|
23
|
+
"verbatimModuleSyntax": true,
|
|
17
24
|
"isolatedModules": true,
|
|
25
|
+
// Forbid any
|
|
18
26
|
"noImplicitAny": true,
|
|
19
27
|
"jsx": "preserve",
|
|
20
28
|
"incremental": true
|