-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
76 lines (75 loc) · 2.24 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
const invalidCodeBlockRules = {
// Invalid rules for embedded code-blocks
"import/no-unresolved": "off",
"no-undef": "off",
"no-unused-expressions": "off",
"no-unused-vars": "off",
"no-unreachable": "off"
};
module.exports = {
root: true,
overrides: [
{
files: ["*.ts"],
excludedFiles: ["*.md/*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.eslint.json",
sourceType: "module"
},
plugins: ["@typescript-eslint", "eslint-plugin"],
extends: [
"eslint:recommended",
"airbnb-base",
"airbnb-typescript/base",
"plugin:eslint-plugin/rules-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
]
},
{
files: ["tests/**"],
env: {
"jest/globals": true
},
extends: [
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:eslint-plugin/tests-recommended"
],
plugins: ["jest"],
rules: {
"import/no-extraneous-dependencies": [
"error",
{ devDependencies: true }
],
"no-console": "off",
"@typescript-eslint/no-non-null-assertion": "off" // Tests should throw errors, jest will catch them
}
},
{
files: ["*.js"],
excludedFiles: ["*.json"],
extends: [
"eslint:recommended",
"airbnb-base",
"plugin:prettier/recommended"
]
},
{
files: ["*.md"],
extends: ["plugin:mdx/recommended"],
settings: {
"mdx/code-blocks": true
}
},
{
// Markdown JS code-blocks (virtual filepath)
files: ["**/*.md/*.js"],
rules: {
...invalidCodeBlockRules
}
}
]
};