-
Notifications
You must be signed in to change notification settings - Fork 34
/
.eslintrc
94 lines (93 loc) · 2.99 KB
/
.eslintrc
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
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"extends": [
"ebay",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"./.eslint.react.js"
],
"ignorePatterns": [
"dist/",
"**/__tests__/**"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018
},
"plugins": [
"jest",
"react",
"@typescript-eslint"
],
"rules": {
// note you must disable the base rule as it can report incorrect errors
"no-use-before-define": "off",
// it's best not to use type 'any' but there are many cases we still need it (not all external & eBay module support type)
"@typescript-eslint/no-explicit-any": "off",
// require() is still necessary for dynamic import or test utils on server-side
"@typescript-eslint/no-var-requires": "off",
// function is hoisted so it's safe to be ignored by this rule
"@typescript-eslint/no-use-before-define": [
"error",
{
"functions": false
}
],
// Not necessary but feel free to turn it on for required return type on any function/method
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-function": "off",
// Ignore unused function arguments
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
],
// need that for shaka-player workaround
"@typescript-eslint/ban-ts-comment": "off",
// works incorrectly with type imports
"no-import-assign": "off",
"react/prop-types": "off",
"semi": ["error", "never"],
"object-curly-spacing": ["error", "always"],
// "quotes": ["error", "backtick"],
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}],
"template-curly-spacing": ["error", "never"],
"no-extra-parens": ["error", "all", {
"nestedBinaryExpressions": false,
"conditionalAssign": true,
"returnAssign": true,
"ignoreJSX": "all"
}],
"react/jsx-indent-props": [2, 4],
"react/jsx-indent": [2, 4],
// airbnb-overrides
"react/jsx-filename-extension": [0],
"react/jsx-closing-bracket-location": 0,
"react/require-default-props": 0,
"react/no-array-index-key": 0,
"react/no-danger": 0,
"react/jsx-fragments": ["warn", "syntax"]
},
"settings": {
"react": {
"version": "detect"
}
}
}