-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
59 lines (59 loc) · 1.64 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
module.exports = {
extends: ['plugin:prettier/recommended'],
env: {
es2020: true,
},
parserOptions: {
sourceType: 'module',
},
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
plugins: ['@typescript-eslint/eslint-plugin', 'eslint-plugin-tsdoc'],
parserOptions: {
project: 'tsconfig.json',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
project: 'tsconfig.json',
},
},
},
rules: {
// If enabled, all exported functions require explicit return types
'@typescript-eslint/explicit-module-boundary-types': 'off',
// We need to use the TS version of this rule.
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
// Enables TSDoc linting.
'tsdoc/syntax': 'warn',
'@typescript-eslint/unbound-method': [
'error',
{
ignoreStatic: true,
},
],
},
},
{
files: ['*test.ts'],
parser: '@typescript-eslint/parser',
extends: ['plugin:jest/recommended', 'plugin:jest/style'],
env: {
node: true,
jest: true,
},
},
],
};