-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
84 lines (84 loc) · 1.94 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
82
83
84
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
plugins: ['@typescript-eslint', 'prefer-arrow-functions'],
parser: '@typescript-eslint/parser',
parserOptions: {
ts: '@typescript-eslint/parser',
js: 'espree',
typescript: '@typescript-eslint/parser',
sourceType: 'module',
ecmaVersion: 2024,
extraFileExtensions: ['.svelte'],
ecmaFeatures: {
globalReturn: false,
impliedStrict: false,
jsx: false
}
},
rules: {
'@typescript-eslint/sort-type-constituents': 'error',
'no-console': ['error'],
'prefer-template': ['error'],
'prefer-arrow-functions/prefer-arrow-functions': [
'error',
{
allowNamedFunctions: false,
classPropertiesAllowed: false,
disallowPrototype: false,
returnStyle: 'implicit',
singleReturnOnly: false
}
]
},
ignorePatterns: [
// Ignore dotfiles
'.*.js',
'.*.cjs',
'ios/*',
'build/*',
'dist/',
'node_modules/*',
'**/*.yaml',
'**/*.css',
'**/*.scss',
/**
* SvelteKit TSConfig automatically ignores this:
*/
'src/service-worker.js'
],
overrides: [
{ files: ['*.cjs'], env: { node: true } },
{
files: ['*.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': [
'error',
{
fixToUnknown: false,
ignoreRestArgs: true
}
],
'@typescript-eslint/explicit-function-return-type': ['error']
}
}
],
env: {
browser: true,
es6: true,
node: true
},
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.base.json',
alwaysTryTypes: true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
}
}
}
};