55 lines
1.6 KiB
JavaScript
55 lines
1.6 KiB
JavaScript
// eslint.config.js
|
|
import js from '@eslint/js';
|
|
import stylistic from '@stylistic/eslint-plugin';
|
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
import react from 'eslint-plugin-react';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import tseslint from 'typescript-eslint';
|
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
plugins: {
|
|
react,
|
|
'react-hooks': reactHooks,
|
|
'jsx-a11y': jsxA11y,
|
|
'@stylistic': stylistic,
|
|
'unused-imports': unusedImports,
|
|
},
|
|
rules: {
|
|
// React 19 JSX transform requires no React in scope
|
|
'react/react-in-jsx-scope': 'off',
|
|
|
|
// Hooks rules
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
|
|
// Accessibility
|
|
'jsx-a11y/alt-text': 'warn',
|
|
|
|
// Style rules (using @stylistic)
|
|
'@stylistic/indent': ['error', 4],
|
|
'@stylistic/semi': ['error', 'always'],
|
|
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
|
|
'@stylistic/no-trailing-spaces': 'error',
|
|
'@stylistic/no-multiple-empty-lines': 'error',
|
|
|
|
'unused-imports/no-unused-imports': 'error',
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
'dist',
|
|
'build',
|
|
'node_modules',
|
|
],
|
|
},
|
|
];
|