-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
41 lines (40 loc) · 1.15 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import jsEslint from '@eslint/js';
import tsEslint from 'typescript-eslint';
import { fixupPluginRules } from '@eslint/compat';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import importPlugin from 'eslint-plugin-import';
import reactPlugin from 'eslint-plugin-react';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import jsxA11y from 'eslint-plugin-jsx-a11y';
/** @type {import("eslint").Linter.Config [];} */
export default tsEslint.config(
{
ignores: ['node_modules', 'dist'],
},
jsEslint.configs.recommended,
...tsEslint.configs.recommended,
eslintPluginPrettierRecommended,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
...reactPlugin.configs.flat.recommended,
...reactPlugin.configs.flat['jsx-runtime'],
settings: { react: { version: 'detect' } },
},
{
plugins: {
import: importPlugin,
'react-hooks': fixupPluginRules(eslintPluginReactHooks),
},
rules: {
...eslintPluginReactHooks.configs.recommended.rules,
},
},
jsxA11y.flatConfigs.recommended,
);