-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
108 lines (102 loc) · 3.12 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
106
107
108
const OFF = "off"
const WARN = "warn"
const ERR = "error"
module.exports = {
root: true,
plugins: ["@typescript-eslint", "jest", "react-hooks", "testing-library"],
extends: [
"@react-native",
"eslint:recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime",
"plugin:testing-library/react",
"prettier", // "prettier" needs to be last!
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 6,
sourceType: "module",
},
settings: {
react: {
version: "detect",
},
},
rules: {
"@typescript-eslint/no-unused-vars": [
WARN,
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"react-hooks/exhaustive-deps": WARN,
/**
* Errors
*/
"import/order": [
ERR,
{
alphabetize: { order: "asc" },
groups: ["builtin", "external", "internal", "index", "sibling", "parent", "object", "type"],
},
],
"import/no-duplicates": ERR,
"react/jsx-curly-brace-presence": ERR,
"react-hooks/rules-of-hooks": ERR,
/**
* Disabled
*/
"@typescript-eslint/await-thenable": OFF,
"@typescript-eslint/ban-ts-comment": OFF,
"@typescript-eslint/ban-types": OFF,
"@typescript-eslint/explicit-module-boundary-types": OFF,
"@typescript-eslint/no-empty-function": OFF,
"@typescript-eslint/no-explicit-any": OFF,
"@typescript-eslint/no-floating-promises": OFF,
"@typescript-eslint/no-implied-eval": OFF,
"@typescript-eslint/no-misused-promises": OFF,
"@typescript-eslint/no-non-null-asserted-optional-chain": OFF,
"@typescript-eslint/no-non-null-assertion": OFF,
"@typescript-eslint/no-unnecessary-type-assertion": OFF,
"@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,
"@typescript-eslint/no-var-requires": OFF,
"@typescript-eslint/require-await": OFF,
"@typescript-eslint/restrict-plus-operands": OFF,
"@typescript-eslint/restrict-template-expressions": OFF,
"@typescript-eslint/strict-boolean-expressions": OFF,
"@typescript-eslint/unbound-method": OFF,
"import/default": OFF,
"import/namespace": OFF,
"import/no-named-as-default-member": OFF,
"import/no-named-as-default": OFF,
"import/no-unresolved": OFF,
"no-control-regex": OFF,
"no-empty-pattern": OFF,
"no-extra-boolean-cast": OFF,
"no-redeclare": OFF,
"no-undef": OFF,
"no-useless-catch": OFF,
"no-useless-escape": OFF,
"react-native/no-inline-styles": OFF,
"react/react-in-jsx-scope": OFF,
},
overrides: [
{
// Test files only
files: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
extends: ["plugin:testing-library/react"],
},
],
}