@viclafouch/eslint-config-viclafouch 4.22.1-beta.4 → 4.22.1-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/.claude/settings.local.json +6 -1
- package/CLAUDE.md +47 -48
- package/README.md +107 -185
- package/bin/init.js +77 -0
- package/eslint.config.mjs +2 -2
- package/index.d.ts +0 -10
- package/index.mjs +0 -2
- package/package.json +4 -1
- package/rules/react.mjs +33 -1
- package/rules/typescript.mjs +983 -102
- package/templates/nextjs.js +17 -0
- package/templates/react.js +24 -0
- package/templates/typescript.js +15 -0
- package/base.mjs +0 -36
- package/better-tailwindcss.mjs +0 -32
- package/rules/best-practices.mjs +0 -517
- package/rules/errors.mjs +0 -46
- package/rules/es6.mjs +0 -218
- package/rules/node.mjs +0 -24
- package/rules/style.mjs +0 -43
- package/rules/variables.mjs +0 -81
package/rules/react.mjs
CHANGED
|
@@ -376,6 +376,10 @@ export default [
|
|
|
376
376
|
}
|
|
377
377
|
],
|
|
378
378
|
|
|
379
|
+
// Require or prevent a new line after jsx elements and expressions
|
|
380
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
|
|
381
|
+
'react/jsx-newline': ['error', { prevent: true }],
|
|
382
|
+
|
|
379
383
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/66b58dd4864678eb869a7bf434c72ff7ac530eb1/docs/rules/no-object-type-as-default-prop.md
|
|
380
384
|
'react/no-object-type-as-default-prop': 'error',
|
|
381
385
|
|
|
@@ -395,7 +399,35 @@ export default [
|
|
|
395
399
|
|
|
396
400
|
// Disable spreading props in components more than once
|
|
397
401
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.35.0/docs/rules/jsx-props-no-spread-multi.md
|
|
398
|
-
'react/jsx-props-no-spread-multi': 'off'
|
|
402
|
+
'react/jsx-props-no-spread-multi': 'off',
|
|
403
|
+
|
|
404
|
+
// Disallow destructured imports from React and ReactDOM - use React.useState, React.useEffect, etc.
|
|
405
|
+
// Disallow useMemo and useCallback unless proven performance problem
|
|
406
|
+
// https://eslint.org/docs/latest/rules/no-restricted-syntax
|
|
407
|
+
'no-restricted-syntax': [
|
|
408
|
+
'error',
|
|
409
|
+
{
|
|
410
|
+
selector: 'ImportDeclaration[source.value="react"] ImportSpecifier',
|
|
411
|
+
message:
|
|
412
|
+
'Use React.useState, React.useEffect, etc. instead of destructuring React imports.'
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
selector:
|
|
416
|
+
'ImportDeclaration[source.value="react-dom"] ImportSpecifier',
|
|
417
|
+
message:
|
|
418
|
+
'Use ReactDOM.createRoot, etc. instead of destructuring ReactDOM imports.'
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
selector: 'CallExpression[callee.property.name="useMemo"]',
|
|
422
|
+
message:
|
|
423
|
+
'Avoid React.useMemo unless you have a proven performance problem.'
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
selector: 'CallExpression[callee.property.name="useCallback"]',
|
|
427
|
+
message:
|
|
428
|
+
'Avoid React.useCallback unless you have a proven performance problem.'
|
|
429
|
+
}
|
|
430
|
+
]
|
|
399
431
|
}
|
|
400
432
|
},
|
|
401
433
|
{
|