-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
52 lines (48 loc) · 1.65 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
plugins: ['react-refresh', 'import'],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: ['tsconfig.json'],
},
},
},
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
// Import plugin rules
//
// https://github.com/import-js/eslint-plugin-import
// https://typescript-eslint.io/docs/linting/troubleshooting#eslint-plugin-import
//'import/no-cycle': 'error', // Extremely useful, yet extremely slow to keep enabled. Worth occasionally enabling locally for finding & removing circular imports.
'import/no-default-export': 'error',
'import/no-unresolved': 'error',
'import/no-self-import': 'error',
'import/no-relative-packages': 'error',
'import/no-duplicates': 'error',
'import/no-mutable-exports': 'error',
'import/exports-last': 'error',
'import/order': [
'error',
{
groups: ['external', 'internal', 'parent', 'sibling', 'index'],
},
],
// TypeScript overrides
'@typescript-eslint/consistent-type-imports': 'error', // Avoid type-only imports being incorrectly bundled: https://vitejs.dev/guide/features.html#typescript
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: 'props|context|event' }],
},
}