-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
69 lines (65 loc) · 1.96 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
import pluginJs from '@eslint/js';
import pluginImport from 'eslint-plugin-import';
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
},
{
languageOptions: {
globals: globals.browser,
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.app.json', './tsconfig.node.json'],
tsconfigRootDir: import.meta.dirname,
},
},
},
{
plugins: {
'react-hooks': fixupPluginRules(pluginReactHooks),
import: fixupPluginRules(pluginImport),
},
},
pluginJs.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...fixupConfigRules(pluginReactConfig),
...fixupConfigRules({
rules: pluginReactHooks.configs.recommended.rules,
}),
...fixupConfigRules({
rules: pluginImport.configs.recommended.rules,
}),
{
ignores: ['dist'],
rules: {
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/consistent-type-imports': ['error'],
'@typescript-eslint/no-empty-interface': 'off',
'import/no-unresolved': 'off',
'import/namespace': 'off',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
},
);