-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
84 lines (73 loc) · 2.05 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
module.exports = {
overrides: [
// Config for all Typescript source files.
{
files: ["src/**/*.ts"],
// The TS files in this test task use the latest syntax and expect a
// browser environment.
env: {
browser: true,
es2020: true,
},
extends: [
// business logic
"eslint:recommended",
"airbnb-typescript/base",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
// tests
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:testing-library/recommended",
"plugin:jest-dom/recommended",
// formatting
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
],
// ESLint works with an AST. We must use a parser that can generate an AST
// from TS code.
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 11,
sourceType: "module",
project: "./tsconfig.json",
},
// Used for their configs used in `extends` section above.
plugins: [
"@typescript-eslint",
"jest",
"jest-dom",
"prettier",
"testing-library",
],
rules: {
// keeping recommended defaults
},
},
// Config for files written in JavaScript used by tooling running on
// Node (i.e., Babel, ESLint, Jest, Webpack config files)
{
files: ["*.js"],
// Config files are run by Node.js
env: {
node: true,
},
// Minimal set of rules for config files.
extends: [
"eslint:recommended",
"airbnb-base",
"plugin:prettier/recommended",
],
parserOptions: {
// Current Node LTS (v12) generally supports up to ES2019 features. See
// https://node.green/.
ecmaVersion: 2019,
},
plugins: ["prettier"],
rules: {
// keeping recommended defaults
},
},
],
};