-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
105 lines (104 loc) · 3.08 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
const common = {
env: {
node: true,
es6: true,
'jest/globals': true,
},
plugins: ['prettier', 'jest', 'markdown'],
extends: [
'airbnb-base',
'plugin:jest/all',
'plugin:markdown/recommended', // REF: https://github.com/eslint/eslint-plugin-markdown/blob/main/lib/index.js
'prettier',
],
rules: {
'prettier/prettier': 'error',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
'jest/expect-expect': 'off',
'jest/prefer-expect-assertions': 'off',
'jest/no-test-return-statement': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'no-console': 'off',
'no-iterator': 'off',
'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'consistent-return': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
},
}
module.exports = {
// ...common,
root: true,
overrides: [
{
/*
eslint-plugin-markdown only finds javascript code block snippet.
For specific spec, refer to https://github.com/eslint/eslint-plugin-markdown
*/
...common,
files: ['**/*.js'],
},
{
/*
eslint-plugin-markdown only finds javascript code block snippet.
For specific spec, refer to https://github.com/eslint/eslint-plugin-markdown
*/
files: ['**/*.md'],
processor: 'markdown/markdown',
},
{
...common,
// In eslint-plugin-markdown v2, configuration for fenced code blocks is separate from the
// containing Markdown file. Each code block has a virtual filename
// appended to the Markdown file's path.
files: ['**/*.md/*.js'],
// Configuration for fenced code blocks goes with the override for
// the code block's virtual filename, for example:
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
},
},
rules: {
...common.rules,
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
},
},
{
...common,
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json', // REF: https://www.npmjs.com/package/eslint-config-airbnb-typescript
},
env: common.env,
plugins: [...common.plugins, '@typescript-eslint'],
extends: [
...common.extends,
'airbnb-typescript/base', // "base" does not include tsx rules. REF: https://www.npmjs.com/package/eslint-config-airbnb-typescript
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'prettier', // Let prettier have high priority
],
rules: {
...common.rules,
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
settings: {
'import/resolver': {
typescript: {},
},
},
},
],
}