@kununu/eslint-config 5.3.0-beta-8 → 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 -12
- package/package.json +1 -2
package/index.js
CHANGED
|
@@ -204,11 +204,16 @@ 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
|
-
|
|
211
|
-
|
|
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
|
+
],
|
|
212
217
|
|
|
213
218
|
};
|
|
214
219
|
|
|
@@ -228,8 +233,7 @@ module.exports = {
|
|
|
228
233
|
plugins: [
|
|
229
234
|
'@babel',
|
|
230
235
|
'lodash',
|
|
231
|
-
'sort-destructure-keys'
|
|
232
|
-
'@shopify',
|
|
236
|
+
'sort-destructure-keys'
|
|
233
237
|
],
|
|
234
238
|
|
|
235
239
|
env: {
|
|
@@ -239,10 +243,7 @@ module.exports = {
|
|
|
239
243
|
es6: true,
|
|
240
244
|
},
|
|
241
245
|
|
|
242
|
-
rules:
|
|
243
|
-
...baseRules,
|
|
244
|
-
'@shopify/prefer-early-return': ['error', { maximumStatements: 1 }],
|
|
245
|
-
},
|
|
246
|
+
rules: baseRules,
|
|
246
247
|
|
|
247
248
|
overrides: [{
|
|
248
249
|
files: [
|
|
@@ -280,7 +281,6 @@ module.exports = {
|
|
|
280
281
|
'**/stories.tsx',
|
|
281
282
|
],
|
|
282
283
|
}],
|
|
283
|
-
'@shopify/prefer-early-return': ['error', { maximumStatements: 1 }],
|
|
284
284
|
},
|
|
285
285
|
overrides: [
|
|
286
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",
|