-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
86 lines (86 loc) · 2.3 KB
/
.eslintrc.json
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
{
"extends": [
"plugin:import/typescript", // this is needed because airbnb uses eslint-plugin-import
"prettier",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"env": {
"browser": true,
"node": true,
"mocha": true,
"jest": true
},
"globals": {
"cy": true,
"Cypress": true,
"JSX": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module",
"tsconfig": "tsconfig.eslint.json"
},
"rules": {
"import/extensions": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
// note you must disable the base rule as it can report incorrect errors
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
// remove when possible
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{ "allowHigherOrderFunctions": true }
],
"import/no-named-as-default": 0,
"no-restricted-syntax": "off",
"no-console": [1, { "allow": ["error", "debug"] }],
"react/prop-types": "off", // Since we do not use prop-types
"react/require-default-props": "off" // Since we do not use prop-types
},
"overrides": [
{
// enable the rule specifically for TypeScript files
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{ "allowHigherOrderFunctions": true }
]
}
},
{
// enable the rule specifically for src files
"files": ["src/**/*.js", "src/**/*.tsx", "src/**/*.ts"],
"rules": {
"no-restricted-syntax": ["error"]
}
},
{
// disable rules for JavaScript files
"files": ["src/**/*.js"],
"rules": { "@typescript-eslint/explicit-module-boundary-types": "off" }
}
],
"settings": {
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
}