@devapoo-dev/eslint-config 1.1.24 → 1.1.25
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 +60 -61
- package/package.json +4 -4
package/index.mjs
CHANGED
|
@@ -122,73 +122,67 @@ export function createConfig(options, ...userConfigs) {
|
|
|
122
122
|
],
|
|
123
123
|
|
|
124
124
|
// react
|
|
125
|
-
...(options?.react
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
'react/no-array-index-key': 'off', // Off to enable composable keys
|
|
125
|
+
...(options?.react && {
|
|
126
|
+
'perfectionist/sort-jsx-props': 'error',
|
|
127
|
+
'react/no-array-index-key': 'off', // Off to enable composable keys
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
: {}),
|
|
129
|
+
// check-file
|
|
130
|
+
'check-file/filename-naming-convention': [
|
|
131
|
+
'error',
|
|
132
|
+
{ [JS_GLOB]: 'KEBAB_CASE', [TS_GLOB]: 'KEBAB_CASE' },
|
|
133
|
+
{ ignoreMiddleExtensions: true },
|
|
134
|
+
],
|
|
135
|
+
'check-file/folder-naming-convention': [
|
|
136
|
+
'error',
|
|
137
|
+
{ [JS_GLOB]: 'KEBAB_CASE', [TS_GLOB]: 'KEBAB_CASE' },
|
|
138
|
+
{ ignoreMiddleExtensions: true },
|
|
139
|
+
],
|
|
140
|
+
}),
|
|
143
141
|
|
|
144
|
-
...
|
|
142
|
+
...options?.rules,
|
|
145
143
|
},
|
|
146
144
|
},
|
|
147
145
|
/**
|
|
148
146
|
* React Routter 7 | Remix.run rules
|
|
149
147
|
*/
|
|
150
148
|
{
|
|
151
|
-
...(options?.remix
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
'shouldRevalidate',
|
|
172
|
-
],
|
|
173
|
-
},
|
|
149
|
+
...(options?.remix && {
|
|
150
|
+
plugins: {
|
|
151
|
+
'react-refresh': reactRefresh,
|
|
152
|
+
},
|
|
153
|
+
rules: {
|
|
154
|
+
// preconfigured rules from eslint-plugin-react-refresh https://github.com/ArnaudBarre/eslint-plugin-react-refresh/tree/main/src
|
|
155
|
+
'react-refresh/only-export-components': [
|
|
156
|
+
'error',
|
|
157
|
+
{
|
|
158
|
+
allowExportNames: [
|
|
159
|
+
'meta',
|
|
160
|
+
'links',
|
|
161
|
+
'headers',
|
|
162
|
+
'loader',
|
|
163
|
+
'action',
|
|
164
|
+
'clientLoader',
|
|
165
|
+
'clientAction',
|
|
166
|
+
'handle',
|
|
167
|
+
'middleware',
|
|
168
|
+
'shouldRevalidate',
|
|
174
169
|
],
|
|
175
170
|
},
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
}),
|
|
178
174
|
},
|
|
179
175
|
{
|
|
180
|
-
...(options?.remix
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
: {}),
|
|
176
|
+
...(options?.remix && {
|
|
177
|
+
files: [
|
|
178
|
+
'**/root.tsx',
|
|
179
|
+
'**/routes/**/*.{ts,tsx}',
|
|
180
|
+
'**/middlewares/**/*.{ts,tsx}',
|
|
181
|
+
],
|
|
182
|
+
rules: {
|
|
183
|
+
'react-naming-convention/context-name': 'off',
|
|
184
|
+
},
|
|
185
|
+
}),
|
|
192
186
|
},
|
|
193
187
|
/**
|
|
194
188
|
* Tailwind CSS
|
|
@@ -221,7 +215,9 @@ export function createConfig(options, ...userConfigs) {
|
|
|
221
215
|
allowedPrefixes: ['GIVEN', 'WHEN', 'THEN', 'AND', 'BUT'],
|
|
222
216
|
},
|
|
223
217
|
],
|
|
224
|
-
|
|
218
|
+
...(options?.react && {
|
|
219
|
+
'react/no-create-ref': 'off',
|
|
220
|
+
}),
|
|
225
221
|
},
|
|
226
222
|
},
|
|
227
223
|
/**
|
|
@@ -243,11 +239,14 @@ export function createConfig(options, ...userConfigs) {
|
|
|
243
239
|
'no-unused-labels': 'off',
|
|
244
240
|
'no-unused-vars': 'off',
|
|
245
241
|
'prefer-const': 'warn',
|
|
246
|
-
'jsx-a11y/alt-text': 'off',
|
|
247
|
-
'jsx-a11y/anchor-has-content': 'off',
|
|
248
242
|
'prefer-let/prefer-let': 'off',
|
|
249
|
-
|
|
250
|
-
|
|
243
|
+
|
|
244
|
+
...(options?.react && {
|
|
245
|
+
'jsx-a11y/alt-text': 'off',
|
|
246
|
+
'jsx-a11y/anchor-has-content': 'off',
|
|
247
|
+
'react/jsx-no-comment-textnodes': 'off',
|
|
248
|
+
'react/jsx-no-undef': 'off',
|
|
249
|
+
}),
|
|
251
250
|
},
|
|
252
251
|
},
|
|
253
252
|
{
|
|
@@ -259,6 +258,6 @@ export function createConfig(options, ...userConfigs) {
|
|
|
259
258
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
260
259
|
},
|
|
261
260
|
},
|
|
262
|
-
...
|
|
261
|
+
...userConfigs,
|
|
263
262
|
);
|
|
264
263
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devapoo-dev/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.25",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"peerDependencies": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@antfu/eslint-config": "^8.2.0",
|
|
12
|
-
"@eslint-react/eslint-plugin": "^
|
|
12
|
+
"@eslint-react/eslint-plugin": "^3.0.0",
|
|
13
13
|
"eslint-config-prettier": "^10.1.8",
|
|
14
14
|
"eslint-plugin-check-file": "^3.3.1",
|
|
15
15
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"eslint": "^9",
|
|
22
22
|
"typescript": "^5",
|
|
23
|
-
"@devapoo-dev/prettier-config": "0.0.
|
|
24
|
-
"@devapoo-dev/tsconfig": "0.0.
|
|
23
|
+
"@devapoo-dev/prettier-config": "0.0.16",
|
|
24
|
+
"@devapoo-dev/tsconfig": "0.0.22"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"lint": "eslint .",
|