-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
53 lines (52 loc) · 1.56 KB
/
eslint.config.mjs
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
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: [
'.vscode-test',
'out',
'dist',
]
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['eslint.config.mjs'],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],
curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
"no-restricted-imports": "off",
"@typescript-eslint/no-restricted-imports": ["warn", {
paths: [{
name: 'vscode',
allowTypeImports: true,
message: "Imports from 'vscode' allowed only in extension.ts & src/vscode, since we cannot import it in unit tests. Type imports are allowed.",
}],
}]
},
},
{
files: ["src/test/unit/**/*.ts"],
rules: {
"@typescript-eslint/unbound-method": "off"
}
},
{
files: ["src/extension.ts", "src/vscode/**/*.ts", "src/test/vscode/**/*.ts"],
rules: {
"@typescript-eslint/no-restricted-imports": "off"
}
}
)