-
Notifications
You must be signed in to change notification settings - Fork 332
/
.eslintrc.js
121 lines (121 loc) · 3.09 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
109
110
111
112
113
114
115
116
117
118
119
120
121
module.exports = {
env: {
node: true,
browser: true,
es6: true,
},
globals: {
__DEV__: "readonly",
__REDUX_DEVTOOLS_EXTENSION__: "readonly",
},
parser: "@typescript-eslint/parser",
plugins: ["react", "react-hooks", "i18next", "jsx-a11y"],
extends: [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:import/typescript",
"plugin:jsx-a11y/recommended",
],
rules: {
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
vars: "all",
args: "after-used",
ignoreRestSiblings: true,
},
],
"no-undef": "off",
"no-shadow": "off",
"no-catch-shadow": "off",
"no-console": [
"error",
{
allow: ["warn", "error"],
},
],
"no-unsafe-optional-chaining": "off",
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["@ledgerhq/live-common/lib/**", "@ledgerhq/live-common/lib-es/**"],
message: "Please remove the /lib import from live-common import.",
},
],
paths: [
"lodash", // you must use the lodash/fp module import style to avoid importing the entire library
],
},
],
"i18next/no-literal-string": [
"error",
{
"jsx-components": {
include: [],
exclude: [],
},
words: {
// Maybe move this to a separate file if it becomes too large.
exclude: [
"\\s*[A-Z0-9ť%!-:-@[-`{-~\\s]+\\s*",
"\\s #LedgerLiveApp\\s*",
"\\s*ledger.com/academy\\s*",
"Baking Bad",
],
},
},
],
"react-native/no-inline-styles": "off",
"react/display-name": "off",
"react/jsx-key": "warn", // TODO: delete to make it an error when we are ready
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "error", // Checks effect dependencies
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/anchor-is-valid": [
"error",
{
components: [],
},
],
},
settings: {
react: {
version: "detect",
},
},
overrides: [
{
files: [
"src/**/*.test.{ts,tsx}",
"src/screens/Settings/Debug/**/*",
"src/screens/FeatureFlagsSettings/**/*",
"src/components/AnalyticsConsole/**/*",
"src/components/StorylyStories/**/*",
"src/screens/Settings/Experimental/**/*",
"src/components/PerformanceConsole/**/*",
"src/components/CustomImage/TestImage.tsx",
"**/*Mock*",
],
rules: {
"i18next/no-literal-string": "off",
"no-console": "off",
},
},
{
files: ["**/jest.config.js", "**/jest-setup.js", "**/e2e/**"],
env: {
jest: true,
},
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
],
};