mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-06-28 14:55:45 +00:00
Replace eslint.config.js with eslint.config.ts and split rules into modular eslint/ files (react, sonar, style, tests, stories, imports). Add custom local/padding-react-hooks rule that enforces padding around React hook calls (no blank lines between hooks, required before/after const/expression). Add @types/eslint-plugin-jsx-a11y and @typescript-eslint/utils as dev deps.
39 lines
940 B
TypeScript
39 lines
940 B
TypeScript
import type { Linter } from 'eslint'
|
|
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
|
import pluginReact from 'eslint-plugin-react'
|
|
import reactCompiler from 'eslint-plugin-react-compiler'
|
|
|
|
const config: Linter.Config[] = [
|
|
pluginReact.configs.flat.recommended as Linter.Config,
|
|
{
|
|
plugins: {
|
|
'react-compiler': reactCompiler,
|
|
react: pluginReact
|
|
},
|
|
rules: {
|
|
'react-compiler/react-compiler': 'error',
|
|
'react/react-in-jsx-scope': 'off',
|
|
'react/jsx-sort-props': [
|
|
'error',
|
|
{
|
|
callbacksLast: true,
|
|
shorthandFirst: true,
|
|
shorthandLast: false,
|
|
ignoreCase: true,
|
|
noSortAlphabetically: false,
|
|
reservedFirst: true
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
|
|
...jsxA11y.flatConfigs.recommended,
|
|
rules: {
|
|
'jsx-a11y/no-autofocus': 'off'
|
|
}
|
|
} as Linter.Config
|
|
]
|
|
|
|
export default config
|