generated from Clarkkkk/vite-vanilla-ts-lib-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
81 lines (81 loc) · 2.47 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
extends: ['standard', 'eslint:recommended', 'plugin:prettier/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'es2022',
sourceType: 'module'
},
plugins: ['@typescript-eslint', 'simple-import-sort'],
rules: {
indent: ['error', 4, { SwitchCase: 1 }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'consistent-return': 'error',
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}
],
'no-redeclare': 'off',
'simple-import-sort/imports': [
'error',
{
groups: [
[
// Side effect imports.
'^\\u0000',
'^@?\\w',
// Internal packages.
'^(src|components|config|utils|pages|hooks|api)(/.*|$)',
// Parent imports. Put `..` last.
'^\\.\\.(?!/?$)',
'^\\.\\./?$',
// Other relative imports. Put same-folder imports and `.` last.
'^\\./(?=.*/)(?!/?$)',
'^\\.(?!/?$)',
'^\\./?$',
// Style imports.
'^.+\\.s?css$'
]
]
}
],
'simple-import-sort/exports': 'error',
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports'
}
],
'no-undef': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{
enums: false,
typedefs: false,
ignoreTypeReferences: false,
functions: false
}
]
},
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-explicit-any': 'off'
}
}
]
}