This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
93 lines (81 loc) · 2.47 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
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"prettier",
"plugin:jest-dom/recommended",
"plugin:testing-library/react",
"plugin:storybook/recommended",
],
plugins: ["@typescript-eslint", "react", "react-hooks", "prettier"],
env: {
browser: true,
es6: true,
node: true,
jest: true,
},
settings: {
react: {
version: "16.8.6",
},
},
globals: {
JSX: "readonly",
NodeJS: "readonly",
},
rules: {
// Help enforce hooks
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// We do not use prop types at the moment
"react/prop-types": "off",
// Don't enforce "noopener noreferrer" security mitigation for now
// https://mathiasbynens.github.io/rel-noopener
"react/jsx-no-target-blank": "off",
// Allow hardcoded " inline
"react/no-unescaped-entities": "off",
// Catch usages of non-defined (forgotten imports) as errors at compile time
"no-undef": "error",
// Warn if any var is used (prefer let or const)
"no-var": "warn",
// Warn if there is an unused variable
"no-unused-vars": [
"warn",
{
ignoreRestSiblings: true,
args: "none",
},
],
// Warn if there is a console output
"no-console": "warn",
// Disallow arrow functions in render functions
"react/jsx-no-bind": "off",
// Disallow inconsistent returns
"consistent-return": "error",
// Allow switch/case fallthrough without requiring a "break" statement after each one
"no-fallthrough": "off",
// Simplify Typescript
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
// Disable new testing-library rules,
"jest-dom/prefer-in-document": "error",
"testing-library/no-wait-for-empty-callback": "error",
"testing-library/no-unnecessary-act": "error",
"testing-library/no-container": "error",
"testing-library/prefer-screen-queries": "error",
"testing-library/no-node-access": "error",
},
};