@viclafouch/eslint-config-viclafouch 4.7.0 → 4.9.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/README.md +14 -19
- package/package.json +16 -16
- package/rules/react.js +4 -1
- package/rules/typescript.js +21 -1
package/README.md
CHANGED
|
@@ -95,15 +95,10 @@ Then, add the TypeScript Eslint rules to your `.eslintrc` file:
|
|
|
95
95
|
|
|
96
96
|
```js
|
|
97
97
|
{
|
|
98
|
-
extends: [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
]
|
|
102
|
-
parserOptions: {
|
|
103
|
-
project: true,
|
|
104
|
-
tsconfigRootDir: __dirname
|
|
105
|
-
},
|
|
106
|
-
root: true
|
|
98
|
+
"extends": [
|
|
99
|
+
"@viclafouch/eslint-config-viclafouch",
|
|
100
|
+
"@viclafouch/eslint-config-viclafouch/typescript"
|
|
101
|
+
]
|
|
107
102
|
}
|
|
108
103
|
```
|
|
109
104
|
|
|
@@ -158,9 +153,9 @@ If you want to sort your imports using your alias at the same time from your `js
|
|
|
158
153
|
|
|
159
154
|
```js
|
|
160
155
|
{
|
|
161
|
-
extends: [
|
|
162
|
-
|
|
163
|
-
|
|
156
|
+
"extends": [
|
|
157
|
+
"@viclafouch/eslint-config-viclafouch",
|
|
158
|
+
"@viclafouch/eslint-config-viclafouch/imports"
|
|
164
159
|
]
|
|
165
160
|
}
|
|
166
161
|
```
|
|
@@ -171,9 +166,9 @@ You can also add additional rules for Next.js. It includes the following configu
|
|
|
171
166
|
|
|
172
167
|
```js
|
|
173
168
|
{
|
|
174
|
-
extends: [
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
"extends": [
|
|
170
|
+
"@viclafouch/eslint-config-viclafouch",
|
|
171
|
+
"@viclafouch/eslint-config-viclafouch/next"
|
|
177
172
|
]
|
|
178
173
|
}
|
|
179
174
|
```
|
|
@@ -184,10 +179,10 @@ You can also add additional rules for only React.js ecosystem (without Next.js).
|
|
|
184
179
|
|
|
185
180
|
```js
|
|
186
181
|
{
|
|
187
|
-
extends: [
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
182
|
+
"extends": [
|
|
183
|
+
"@viclafouch/eslint-config-viclafouch",
|
|
184
|
+
"@viclafouch/eslint-config-viclafouch/react",
|
|
185
|
+
"@viclafouch/eslint-config-viclafouch/hooks"
|
|
191
186
|
]
|
|
192
187
|
}
|
|
193
188
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viclafouch/eslint-config-viclafouch",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "ESLint and Prettier Config from Victor de la Fouchardiere",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -24,33 +24,33 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"homepage": "https://github.com/viclafouch/eslint-config-viclafouch#readme",
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"eslint": "^8.
|
|
28
|
-
"prettier": "^3.
|
|
29
|
-
"typescript": "^5.
|
|
27
|
+
"eslint": "^8.57.0",
|
|
28
|
+
"prettier": "^3.2.5",
|
|
29
|
+
"typescript": "^5.4.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/core": "^7.
|
|
33
|
-
"@babel/eslint-parser": "^7.
|
|
34
|
-
"@next/eslint-plugin-next": "^14.1.
|
|
35
|
-
"@rushstack/eslint-patch": "^1.
|
|
32
|
+
"@babel/core": "^7.24.3",
|
|
33
|
+
"@babel/eslint-parser": "^7.24.1",
|
|
34
|
+
"@next/eslint-plugin-next": "^14.1.4",
|
|
35
|
+
"@rushstack/eslint-patch": "^1.8.0",
|
|
36
36
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
38
|
-
"@typescript-eslint/parser": "^
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
38
|
+
"@typescript-eslint/parser": "^7.4.0",
|
|
39
39
|
"app-root-path": "^3.1.0",
|
|
40
40
|
"babel-loader": "^9.1.3",
|
|
41
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.57.0",
|
|
42
42
|
"eslint-config-prettier": "^9.1.0",
|
|
43
43
|
"eslint-plugin-import": "^2.29.1",
|
|
44
44
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
45
45
|
"eslint-plugin-prettier": "^5.1.3",
|
|
46
46
|
"eslint-plugin-promise": "^6.1.1",
|
|
47
|
-
"eslint-plugin-react": "^7.
|
|
47
|
+
"eslint-plugin-react": "^7.34.1",
|
|
48
48
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
49
|
-
"eslint-plugin-simple-import-sort": "^
|
|
49
|
+
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
50
50
|
"eslint-plugin-testing-library": "^6.2.0",
|
|
51
|
-
"get-tsconfig": "^4.7.
|
|
52
|
-
"prettier": "^3.2.
|
|
53
|
-
"typescript": "^5.
|
|
51
|
+
"get-tsconfig": "^4.7.3",
|
|
52
|
+
"prettier": "^3.2.5",
|
|
53
|
+
"typescript": "^5.4.3"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"lint": "eslint .",
|
package/rules/react.js
CHANGED
package/rules/typescript.js
CHANGED
|
@@ -120,7 +120,27 @@ module.exports = {
|
|
|
120
120
|
|
|
121
121
|
// Require consistently using T[] instead of Array<T>
|
|
122
122
|
// https://typescript-eslint.io/rules/array-type
|
|
123
|
-
'@typescript-eslint/array-type': 'error'
|
|
123
|
+
'@typescript-eslint/array-type': 'error',
|
|
124
|
+
|
|
125
|
+
// Forbid delete array, use splice for example
|
|
126
|
+
// https://typescript-eslint.io/rules/no-array-delete/
|
|
127
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
128
|
+
|
|
129
|
+
// Don't do array.filter(callback)[0], use arrat.find instead
|
|
130
|
+
// https://typescript-eslint.io/rules/prefer-find
|
|
131
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
132
|
+
|
|
133
|
+
// Prefer to use String.startsWith and String.endsWith
|
|
134
|
+
// https://typescript-eslint.io/rules/prefer-string-starts-ends-with
|
|
135
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
136
|
+
|
|
137
|
+
// Prefer to use unknown instead of any for error in catch callback
|
|
138
|
+
// https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
|
|
139
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
|
|
140
|
+
|
|
141
|
+
// No more "as Record<any, any>" in Array.reduce initial value, use generics
|
|
142
|
+
// https://typescript-eslint.io/rules/prefer-reduce-type-parameter
|
|
143
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'error'
|
|
124
144
|
|
|
125
145
|
// '@typescript-eslint/ban-types': [
|
|
126
146
|
// 'error',
|