mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-18 03:26:38 +08:00
feat: migrate ESLint to v9 flat config
- Replace .eslintrc.json with eslint.config.mjs - Simplify configuration using @antfu/eslint-config - Add necessary ESLint plugin dependencies - Disable overly strict style rules - Set package.json type to module for ESM support - Fix ESLint disable comment format 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
67
eslint.config.mjs
Normal file
67
eslint.config.mjs
Normal file
@ -0,0 +1,67 @@
|
||||
import { combine, javascript, typescript, stylistic } from '@antfu/eslint-config'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
|
||||
export default combine(
|
||||
javascript({
|
||||
overrides: {
|
||||
'no-unused-vars': 'off',
|
||||
'no-console': 'off',
|
||||
},
|
||||
}),
|
||||
|
||||
typescript(),
|
||||
|
||||
stylistic({
|
||||
lessOpinionated: true,
|
||||
jsx: false,
|
||||
semi: false,
|
||||
quotes: 'single',
|
||||
overrides: {
|
||||
'style/indent': ['error', 2],
|
||||
'style/quotes': ['error', 'single'],
|
||||
'style/max-statements-per-line': 'off',
|
||||
},
|
||||
}),
|
||||
|
||||
{
|
||||
plugins: {
|
||||
'react-hooks': reactHooks,
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
'unused-imports/no-unused-vars': 'warn',
|
||||
'unused-imports/no-unused-imports': 'warn',
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'ts/no-use-before-define': 'off',
|
||||
'style/brace-style': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
ignores: [
|
||||
'**/node_modules/**',
|
||||
'**/dist/**',
|
||||
'**/build/**',
|
||||
'**/out/**',
|
||||
'**/.next/**',
|
||||
'**/public/**',
|
||||
'**/*.json',
|
||||
'tailwind.config.js',
|
||||
'next.config.js',
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.es2025,
|
||||
...globals.node,
|
||||
React: 'readable',
|
||||
JSX: 'readable',
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user