mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-06-27 14:26:06 +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.
57 lines
1.1 KiB
TypeScript
57 lines
1.1 KiB
TypeScript
import js from '@eslint/js'
|
|
import type { Linter } from 'eslint'
|
|
import globals from 'globals'
|
|
import process from 'node:process'
|
|
import tseslint from 'typescript-eslint'
|
|
|
|
import {
|
|
importsConfig,
|
|
reactConfig,
|
|
sonarConfig,
|
|
storiesConfig,
|
|
styleConfig,
|
|
testsConfig
|
|
} from './eslint/index'
|
|
|
|
const config: Linter.Config[] = [
|
|
{
|
|
ignores: [
|
|
'**/*.config.ts',
|
|
'**/*.config.js',
|
|
'**/dist/',
|
|
'dist/',
|
|
'tools/src/templates/**',
|
|
'**/storybook-static/'
|
|
]
|
|
},
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
...globals.browser
|
|
},
|
|
sourceType: 'module',
|
|
parserOptions: {
|
|
project: './tsconfig.eslint.json',
|
|
tsconfigRootDir: process.cwd(),
|
|
sourceType: 'module'
|
|
}
|
|
}
|
|
},
|
|
|
|
// JS/TS Presets
|
|
js.configs.recommended as Linter.Config,
|
|
...(tseslint.configs.recommended as Linter.Config[]),
|
|
|
|
// Feature / Plugin Configs
|
|
...reactConfig,
|
|
...sonarConfig,
|
|
...importsConfig,
|
|
...styleConfig,
|
|
...testsConfig,
|
|
...storiesConfig
|
|
]
|
|
|
|
export default config
|