@kununu/eslint-config 5.3.0-beta-4 → 5.3.0-beta-6
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 +7 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -203,6 +203,11 @@ const baseRules = {
|
|
|
203
203
|
|
|
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
|
+
|
|
207
|
+
'no-restricted-syntax': ['error', {
|
|
208
|
+
selector: 'ReturnStatement > LogicalExpression[operator="&&"]',
|
|
209
|
+
message: 'Prefer early returns over logical expressions in return statements. Use if (condition) return value; instead.'
|
|
210
|
+
}],
|
|
206
211
|
};
|
|
207
212
|
|
|
208
213
|
module.exports = {
|
|
@@ -234,7 +239,7 @@ module.exports = {
|
|
|
234
239
|
|
|
235
240
|
rules: {
|
|
236
241
|
...baseRules,
|
|
237
|
-
'@shopify/prefer-early-return': 'error',
|
|
242
|
+
'@shopify/prefer-early-return': ['error', { maximumStatements: 1 }],
|
|
238
243
|
},
|
|
239
244
|
|
|
240
245
|
overrides: [{
|
|
@@ -273,6 +278,7 @@ module.exports = {
|
|
|
273
278
|
'**/stories.tsx',
|
|
274
279
|
],
|
|
275
280
|
}],
|
|
281
|
+
'@shopify/prefer-early-return': 'error',
|
|
276
282
|
},
|
|
277
283
|
overrides: [
|
|
278
284
|
{
|