-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
72 lines (72 loc) · 2.31 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
module.exports = {
env: {
browser: false,
es2021: true,
},
// Note that order here matters
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/recommended",
"prettier",
],
plugins: ["notice"],
rules: {
// Allow empty generators
"require-yield": "off",
// Assume variables prefixed with "_" are intentionally unused
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "_.*", varsIgnorePattern: "_.*" },
],
// Explicit any should be used judiciously to avoid undue wrestling with TS
"@typescript-eslint/no-explicit-any": "off",
// no-empty-function is just pedantic
"@typescript-eslint/no-empty-function": "off",
// TODO: fix these in the future (all variations of using `any`)
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
// We may want to improve namespaces at some point, but at this juncture they make
// our type system more readable
"@typescript-eslint/no-namespace": "off",
// This is just so we don't accidentally render '[object: Object]'
"@typescript-eslint/restrict-template-expressions": [
"warn",
{ allowNumber: true, allowNullish: true, allowBoolean: true },
],
// This prevents trivial implementations of asynchronous interfaces
"@typescript-eslint/require-await": "off",
// For code readability; do not apply to intersections as then order matters
"@typescript-eslint/sort-type-constituents": [
"warn",
{ checkIntersections: false },
],
"@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }],
// Use `print1` and `print2` instead
"no-console": "error",
"notice/notice": [
"error",
{
templateFile: "copyright.js",
},
],
},
ignorePatterns: [
".eslintrc.js",
"prettier.config.js",
"jest.config.js",
"public/**",
"dist/**",
"__mocks__/**",
"node_modules/**",
],
overrides: [],
parserOptions: {
ecmaVersion: "latest",
project: ["./tsconfig.json"],
sourceType: "module",
},
};