forked from mohitbagra/azure-devops-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
82 lines (80 loc) · 2.92 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
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react", "simple-import-sort", "prettier", "import"],
"env": {
"browser": true,
"node": true
},
"extends": ["plugin:prettier/recommended", "plugin:@typescript-eslint/recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
// sort imports
"simple-import-sort/sort": [
"error",
{
"groups": [
// Styles first
["^.+\\.s?css$"],
// React 2nd
["^react$", "^react-dom$"],
// Side effect imports.
["^\\u0000"],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
["^@?\\w"],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything that does not start with a dot.
["^[^.]"],
// Relative imports.
// Anything that starts with a dot.
["^\\."]
]
}
],
"sort-imports": "off",
"prettier/prettier": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
// stylistic rules
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-function": "off",
"eol-last": ["error", "always"],
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
"no-empty": "error",
"@typescript-eslint/camelcase": "off",
// code-quality rules
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"radix": "off",
"react/prop-types": "off",
"no-unsafe-finally": "error",
"no-unused-expressions": ["error", { "allowShortCircuit": false, "allowTernary": true }],
"no-var": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"react/display-name": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/interface-name-prefix": [
"error",
{
"prefixWithI": "always"
}
]
},
"settings": {
"react": {
"version": "detect"
}
}
}