-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
87 lines (87 loc) · 3.19 KB
/
.eslintrc.js
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
/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"prettier",
],
overrides: [
{
files: ["**/*.js", "**/.*.js"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
],
rules: {
"arrow-body-style": ["warn", "never"],
camelcase: "warn",
"func-style": ["warn", "declaration", { allowArrowFunctions: true }],
"no-alert": "warn",
"no-console": "warn",
"no-else-return": "warn",
"no-implicit-coercion": "warn",
"no-return-assign": "warn",
"no-return-await": "off",
"no-throw-literal": "warn",
"no-useless-return": "warn",
"no-void": "warn",
"react/hook-use-state": "warn",
"react/jsx-boolean-value": ["warn", "never"],
"react/jsx-curly-brace-presence": [
"warn",
{ props: "never", children: "never", propElementValues: "always" },
],
"react/jsx-fragments": ["warn", "syntax"],
"react/jsx-no-constructed-context-values": "warn",
"react/jsx-no-script-url": "warn",
"react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
"react/jsx-sort-props": "warn",
"react/no-array-index-key": "warn",
"react/no-danger": "warn",
"react/no-invalid-html-attribute": "warn",
"react/no-multi-comp": "warn",
"react/no-namespace": "warn",
"react/no-unstable-nested-components": "warn",
"react/no-unused-prop-types": "warn",
"react/self-closing-comp": "warn",
"@typescript-eslint/array-type": ["warn", { default: "generic" }],
"@typescript-eslint/consistent-type-assertions": ["warn", { assertionStyle: "never" }],
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/consistent-type-exports": [
"warn",
{ fixMixedExportsWithInlineTypeSpecifier: false },
],
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports", disallowTypeAnnotations: true },
],
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/no-floating-promises": ["warn", { ignoreVoid: true }],
"@typescript-eslint/no-misused-promises": [
"warn",
{ checksVoidReturn: { arguments: false, attributes: false } },
],
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/return-await": ["warn", "in-try-catch"],
"@typescript-eslint/strict-boolean-expressions": [
"warn",
{ allowString: false, allowNumber: false, allowNullableObject: false },
],
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/unbound-method": ["warn", { ignoreStatic: true }],
},
};