Files
WebChat/eslint.config.ts

46 lines
1.6 KiB
TypeScript
Raw Permalink Normal View History

2024-10-27 09:02:56 +08:00
// import type { Linter } from 'eslint'
2024-09-16 13:44:16 +08:00
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import reactPlugin from '@eslint-react/eslint-plugin'
2025-05-21 21:18:29 +08:00
// https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/325
// import tailwindPlugin from 'eslint-plugin-tailwindcss'
2024-09-16 13:44:16 +08:00
import prettierPlugin from 'eslint-plugin-prettier/recommended'
import * as tsParser from '@typescript-eslint/parser'
export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{
languageOptions: { globals: globals.browser }
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
2025-05-21 21:18:29 +08:00
// ...tailwindPlugin.configs['flat/recommended'],
2024-09-16 13:44:16 +08:00
prettierPlugin,
{
files: ['**/*.{ts,tsx}'],
...reactPlugin.configs.recommended,
languageOptions: {
parser: tsParser
}
},
{
2025-05-21 21:18:29 +08:00
ignores: ['**/.output/*', '**/.wxt/*', '**/ui/**', '**/magicui/**', '**/lib/**', '**/patches/**']
2024-09-16 13:44:16 +08:00
},
{
rules: {
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@eslint-react/no-array-index-key': 'off',
'@eslint-react/hooks-extra/no-redundant-custom-hook': 'off',
2024-10-19 01:18:07 +08:00
'@eslint-react/dom/no-missing-button-type': 'off',
2025-05-21 21:18:29 +08:00
'@eslint-react/hooks-extra/prefer-use-state-lazy-initialization': 'off',
'@eslint-react/no-unstable-context-value': 'off',
'@typescript-eslint/consistent-type-imports': 'error'
2024-09-16 13:44:16 +08:00
}
}
]
2024-10-19 01:18:07 +08:00
// satisfies Linter.Config[]