update eslint and refactor backend
This commit is contained in:
@@ -1,54 +1,22 @@
|
||||
// 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';
|
||||
import config from '@sebastianbrenner/eslint-config/src/index.js';
|
||||
|
||||
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',
|
||||
},
|
||||
},
|
||||
},
|
||||
...config,
|
||||
{
|
||||
ignores: [
|
||||
'dist',
|
||||
'build',
|
||||
'node_modules',
|
||||
],
|
||||
rules: {
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/jsx-newline": ["error", { "prevent": true }],
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"indent": ["error", 4]
|
||||
},
|
||||
settings: {
|
||||
'import/core-modules': ['bun' ]
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user