-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
.eslintrc.js
91 lines (89 loc) · 2.52 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
'use strict';
const config = {
extends: ['stylelint'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'script',
project: ['./tsconfig.src.json', './tsconfig.test.json', './tsconfig.scripts.json'],
},
env: {
node: true,
es2020: true,
},
reportUnusedDisableDirectives: true,
rules: {
strict: ['error', 'safe'],
'n/no-missing-require': [
'error',
{ allowModules: ['vscode'], tryExtensions: ['.js', '.json', '.ts'] },
],
'n/no-missing-import': [
'error',
{ allowModules: ['vscode'], tryExtensions: ['.js', '.json', '.ts'] },
],
'require-jsdoc': 'error',
'no-warning-comments': ['warn', { terms: ['todo'], location: 'start' }],
'sort-imports': 'off',
},
overrides: [
{
files: ['**/*.ts'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'no-shadow': 'off',
'no-use-before-define': 'off',
strict: ['error', 'never'],
'n/no-unsupported-features/es-syntax': 'off',
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/explicit-module-boundary-types': ['error'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/switch-exhaustiveness-check': ['error'],
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowNumber: true,
allowNullish: true,
},
],
},
},
{
files: ['**/*.d.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'n/no-unpublished-import': 'off',
},
},
{
files: ['**/__tests__/**/*', '**/__mocks__/**/*', 'test/**/*'],
extends: ['stylelint/jest'],
rules: {
'n/no-unpublished-require': 'off',
'n/no-unpublished-import': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
},
},
{
files: ['test/e2e/__tests__/**/*'],
rules: {
'jest/expect-expect': 'off',
},
},
],
};
module.exports = config;