@kununu/eslint-config 5.3.0-beta-7 → 5.3.0-beta-9
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.js +12 -13
- package/package.json +1 -2
package/index.js
CHANGED
|
@@ -204,13 +204,17 @@ const baseRules = {
|
|
|
204
204
|
// https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops
|
|
205
205
|
'react/require-default-props': 0,
|
|
206
206
|
|
|
207
|
-
'no-restricted-syntax': ['error',
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
'no-restricted-syntax': ['error',
|
|
208
|
+
{
|
|
209
|
+
selector: 'ReturnStatement > LogicalExpression[operator="&&"]',
|
|
210
|
+
message: 'Prefer early returns over logical expressions in return statements. Use if (condition) return value; instead.'
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
selector: 'ReturnStatement > SequenceExpression LogicalExpression[operator="&&"]',
|
|
214
|
+
message: 'Prefer early returns over logical expressions in return statements. Use if (condition) return value; instead.'
|
|
215
|
+
}
|
|
216
|
+
],
|
|
211
217
|
|
|
212
|
-
// Use our custom rule from the plugin if available
|
|
213
|
-
'kununu/prefer-early-return': 'error',
|
|
214
218
|
};
|
|
215
219
|
|
|
216
220
|
module.exports = {
|
|
@@ -229,8 +233,7 @@ module.exports = {
|
|
|
229
233
|
plugins: [
|
|
230
234
|
'@babel',
|
|
231
235
|
'lodash',
|
|
232
|
-
'sort-destructure-keys'
|
|
233
|
-
'kununu' // Add our custom plugin
|
|
236
|
+
'sort-destructure-keys'
|
|
234
237
|
],
|
|
235
238
|
|
|
236
239
|
env: {
|
|
@@ -240,10 +243,7 @@ module.exports = {
|
|
|
240
243
|
es6: true,
|
|
241
244
|
},
|
|
242
245
|
|
|
243
|
-
rules:
|
|
244
|
-
...baseRules,
|
|
245
|
-
'@shopify/prefer-early-return': ['error', { maximumStatements: 1 }],
|
|
246
|
-
},
|
|
246
|
+
rules: baseRules,
|
|
247
247
|
|
|
248
248
|
overrides: [{
|
|
249
249
|
files: [
|
|
@@ -281,7 +281,6 @@ module.exports = {
|
|
|
281
281
|
'**/stories.tsx',
|
|
282
282
|
],
|
|
283
283
|
}],
|
|
284
|
-
'@shopify/prefer-early-return': ['error', { maximumStatements: 1 }],
|
|
285
284
|
},
|
|
286
285
|
overrides: [
|
|
287
286
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kununu/eslint-config",
|
|
3
|
-
"version": "5.3.0-beta-
|
|
3
|
+
"version": "5.3.0-beta-9",
|
|
4
4
|
"description": "kununu's ESLint config",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "kununu/eslint-config",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"@babel/core": "7.26.9",
|
|
30
30
|
"@babel/eslint-parser": "7.26.8",
|
|
31
31
|
"@babel/eslint-plugin": "7.25.9",
|
|
32
|
-
"@shopify/eslint-plugin": "47.0.1",
|
|
33
32
|
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
34
33
|
"@typescript-eslint/parser": "7.18.0",
|
|
35
34
|
"eslint": "8.57.1",
|