Files
honghe-acfic-chat/eslint.config.ts
2025-08-31 01:59:51 +08:00

61 lines
1.6 KiB
TypeScript

import globals from 'globals'
import jsLint from '@eslint/js'
import tsLint from 'typescript-eslint'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import a11yLint from 'eslint-plugin-jsx-a11y'
import nextLint from '@next/eslint-plugin-next'
export default tsLint.config(
{
ignores: [
'src/components/ui',
'src/components/magicui',
'src/types/openapi.d.ts',
],
},
{
extends: [jsLint.configs.recommended, ...tsLint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'@next/next': nextLint,
'jsx-a11y': a11yLint,
},
rules: {
...reactHooks.configs.recommended.rules,
'no-console': 'warn',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
// Enforce type-only imports for TypeScript types
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
disallowTypeAnnotations: false,
},
],
},
}
)