forked from game-ci/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
84 lines (84 loc) · 2.65 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
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true,
"jsx": true
},
"project": "./tsconfig.json"
},
"extends": [
"airbnb-typescript",
"plugin:unicorn/recommended",
"plugin:jest/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"plugins": ["react", "jsx-a11y", "import", "jest", "unicorn", "prettier"],
"settings": {
"react": { "version": "detect" },
"import/resolver": { "typescript": {} }
},
"rules": {
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["hrefLeft", "hrefRight"],
"aspects": ["invalidHref", "preferButton"]
}
],
"unicorn/prevent-abbreviations": [
"error",
{
"replacements": {
"props": { "properties": false },
"ref": { "reference": false }
}
}
],
// Waiting for AirBnb upgrade: https://github.com/typescript-eslint/typescript-eslint/issues/2077#issuecomment-634811363
"@typescript-eslint/camelcase": "off",
// Conflict between prettier and eslint-unicorn
"react/jsx-wrap-multilines": "off",
// Allow forOfStatements
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"],
// Continue is viable in forOf loops in generators
"no-continue": "off",
// Spreading is needed in case of forwarding props
"react/jsx-props-no-spreading": "off",
// Allow inline <strong> tags
"react/jsx-one-expression-per-line": "off",
// React components should be able to return null
"unicorn/no-null": "off",
// Redux and Immer use prop reassign by design
"no-param-reassign": ["error", { "props": false }],
// For react components it's not always useful to move small methods up in scope
"unicorn/consistent-function-scoping": ["error", { "checkArrowFunctions": false }],
// From experience, named exports are almost always desired. I got tired of this rule
"import/prefer-default-export": "off",
// Firebase requires importing each module that's used
"import/no-duplicates": "off",
// Allow camelCase and PascalCase (kebab-case for md files)
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"pascalCase": true,
"kebabCase": true
}
}
]
}
}