-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
165 lines (165 loc) · 3.92 KB
/
.eslintrc.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:unicorn/recommended'
],
ignorePatterns: [
'node_modules',
'dist',
'perf',
'tmp',
'coverage',
'_tmp',
'cache',
'native.d.ts',
'/test/*/samples/**/*.*',
'!/test/*/samples/**/_config.js',
'!/test/*/samples/**/rollup.config.js',
'!.vitepress',
'/wasm/',
'/wasm-node/'
],
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/prefer-module': 'off'
}
},
{
files: ['./*.ts', 'cli/**/*.ts'],
rules: {
'unicorn/no-process-exit': 'off'
}
},
{
files: ['*.js', 'cli/**/*.ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off'
}
},
{
env: {
mocha: true
},
files: ['test/**/*.js'],
rules: {
'sort-keys': 'off'
}
},
{
extends: [
'plugin:vue/vue3-essential',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier'
],
files: ['*.vue']
},
{
files: ['docs/repl/examples/**/*.js'],
rules: {
'import/namespace': 'off',
'import/no-unresolved': 'off',
'no-undef': 'off',
'unicorn/prevent-abbreviations': 'off'
}
},
{
files: ['test/**/_config.js'],
rules: {
'no-undef': 'off'
}
}
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/consistent-type-assertions': [
'error',
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }
],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/member-ordering': [
'error',
{
default: {
memberTypes: [],
order: 'alphabetically'
}
}
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true, varsIgnorePattern: '^_' }
],
'arrow-body-style': ['error', 'as-needed'],
'dot-notation': 'error',
'import/no-unresolved': [
'error',
{
// 'fsevents' is only available on macOS, and not installed on linux/windows
ignore: [
'fsevents',
'help.md',
'is-reference',
'package.json',
'types',
'examples.json',
'locate-character'
]
}
],
'import/order': ['error', { alphabetize: { order: 'asc' } }],
'no-constant-condition': ['error', { checkLoops: false }],
'no-prototype-builtins': 'off',
'object-shorthand': 'error',
'prefer-const': ['error', { destructuring: 'all' }],
'prefer-object-spread': 'error',
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false
}
],
'sort-keys': ['error', 'asc', { caseSensitive: false }],
'unicorn/consistent-destructuring': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-empty-file': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/no-null': 'off',
'unicorn/no-this-assignment': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/number-literal-case': 'off',
'unicorn/prefer-at': 'off',
'unicorn/prefer-code-point': 'off',
'unicorn/prefer-math-trunc': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prefer-string-raw': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prefer-structured-clone': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': ['error', { replacements: { dir: false } }]
}
};