This repository has been archived by the owner on Dec 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.json
103 lines (103 loc) · 3.22 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended"
],
"globals": { "inTest": "writable" },
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"promise",
"react",
"react-hooks",
"simple-import-sort",
"sort-destructure-keys"
],
"rules": {
"comma-dangle": ["error", "never"],
"function-paren-newline": ["error", { "minItems": 8 }],
"indent": ["error", "tab"],
"quotes": ["error", "single", { "avoidEscape": true }],
"newline-before-return": "error",
"no-bitwise": "off",
"no-multiple-empty-lines": ["error", {"max": 1}],
"no-trailing-spaces": ["warn"],
"no-unused-vars": ["error", { "args": "none" }],
"object-curly-spacing": ["error", "always"],
"object-curly-newline": ["error", {
"ImportDeclaration": "never",
"ObjectPattern": "never"
}],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"] },
{ "blankLine": "always", "prev": "*", "next": "block-like" },
{ "blankLine": "always", "prev": "block-like", "next": "*" },
{ "blankLine": "always", "prev": "*", "next": "function" },
{ "blankLine": "always", "prev": "function", "next": "*" },
{ "blankLine": "always", "prev": "*", "next": "try" },
{ "blankLine": "always", "prev": "try", "next": "*" },
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": "*", "next": "import" },
{ "blankLine": "always", "prev": "import", "next": "*" },
{ "blankLine": "any", "prev": "import", "next": "import" }
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"react/jsx-fragments": "error",
"react/jsx-max-props-per-line": [2, {
"maximum": 1,
"when": "always"
}],
"react/jsx-sort-props": [2, {
"noSortAlphabetically": false
}],
"sort-destructure-keys/sort-destructure-keys": [2, {
"caseSensitive": true
}],
"simple-import-sort/imports": [2, {
"groups": [
["^\u0000"], // all side-effects (0 at start)
["\u0000$", "^@polkadot.*\u0000$", "^\\..*\u0000$"], // types (0 at end)
["\u0000$", "^@.*\u0000$", "^\\..*\u0000$"], // types (0 at end)
["^[^/\\.]"], // non-polkadot
["^@polkadot"], // polkadot
["^\\.\\.(?!/?$)", "^\\.\\./?$", "^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"] // local (. last)
]
}],
"sort-keys": "error",
"semi": "off",
"space-in-parens": ["error", "never"],
"switch-colon-spacing": ["error", {"after": true, "before": false}]
},
"settings": {
"import/ignore": "react-navigation",
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {
"alwaysTryTypes": true // always try to resolve types under `<roo/>@types` directory even it doesn"t contain any source code, like `@types/unist`
}
},
"react": {
"pragma": "React",
"version": "detect"
}
}
}