forked from luan/slenderaac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
110 lines (110 loc) · 2.71 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
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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
extraFileExtensions: ['.svelte'],
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:you-dont-need-lodash-underscore/compatible',
'plugin:svelte/prettier',
'plugin:prettier/recommended',
],
plugins: ['svelte', '@typescript-eslint', 'simple-import-sort', 'import'],
ignorePatterns: ['*.cjs', '*.config.js'],
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
'import/first': 'off',
'import/no-duplicates': 'off',
'import/no-named-as-default': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
},
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
espree: ['.js', 'jsx', '.cjs', '.mjs'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
env: {
browser: true,
es2017: true,
node: true,
},
rules: {
'comma-dangle': ['error', 'always-multiline'],
'simple-import-sort/imports': [
'error',
{
// The default grouping, but with type imports first in each group.
groups: [
['^\\u0000'],
['^node:.*\\u0000$', '^node:'],
['^@?\\w.*\\u0000$', '^@?\\w'],
['^\\$app?\\w.*\\u0000$', '^\\$app?\\w'],
['^\\$lib?\\w.*\\u0000$', '^\\$lib?\\w'],
['^\\$models?\\w.*\\u0000$', '^\\$models?\\w'],
['^\\$server?\\w.*\\u0000$', '^\\$server?\\w'],
['^\\$ui?\\w.*\\u0000$', '^\\$ui?\\w'],
['^\\$?\\w.*\\u0000$', '^\\$?\\w'],
['^~?\\w.*\\u0000$', '^~?\\w'],
['(?<=\\u0000)$', '^'],
['^\\..*\\u0000$', '^\\.'],
],
},
],
'simple-import-sort/exports': 'error',
'import/newline-after-import': 'error',
'import/no-unresolved': 'off', // This is handled by TypeScript
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false,
},
],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'@typescript-eslint/no-floating-promises': [
'error',
{
ignoreVoid: true,
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
'you-dont-need-lodash-underscore/is-string': 'off',
'you-dont-need-lodash-underscore/is-nil': 'off',
},
};