-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
58 lines (56 loc) · 1.75 KB
/
eslint.config.js
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
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js'
import { fixupConfigRules } from '@eslint/compat'
import prettierConfig from 'eslint-config-prettier'
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended'
import importPlugin from 'eslint-plugin-import'
const config = [
{ languageOptions: { globals: globals.browser } },
prettierConfig,
prettierPluginRecommended,
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...fixupConfigRules(pluginReactConfig),
{
files: ['src/**/*.{js,ts,tsx}'],
plugins: { import: importPlugin },
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'import/no-namespace': 'error',
'import/no-duplicates': 'error',
'import/order': [
'error',
{
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
groups: ['builtin', 'external', 'internal', 'unknown', ['parent', 'sibling', 'index']],
pathGroupsExcludedImportTypes: ['builtin'],
pathGroups: [
{
pattern: '{services,hooks,utils}/**',
group: 'external',
position: 'after',
},
],
},
],
},
settings: {
version: 'detect',
'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'] },
'import/resolver': {
node: {
extensions: ['.ts', '.tsx'],
},
typescript: {
project: 'packages/**/tsconfig.json',
},
},
'import/extensions': ['.ts', '.tsx'],
},
},
{ ignores: ['dist/*'] },
]
export default config