-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
130 lines (124 loc) Β· 5.78 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"extends": [
// Enable baseline ruleset
"eslint:all",
// Disable rules that are incompatible with or better handled by TypeScript
"plugin:@typescript-eslint/eslint-recommended",
// Turn on TypeScript-specific rules
"plugin:@typescript-eslint/all",
// Next.js
"next/core-web-vitals"
],
"reportUnusedDisableDirectives": true,
"rules": {
// Error
"@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": false }],
"@typescript-eslint/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"@typescript-eslint/indent": ["error", "tab"],
"@typescript-eslint/naming-convention": ["error", { "selector": "default", "format": ["camelCase"] }, { "selector": ["function", "variable"], "format": ["camelCase", "PascalCase", "UPPER_CASE"], "leadingUnderscore": "allowSingleOrDouble" }, { "selector": ["parameter", "variable"], "modifiers": ["destructured"], "format": null }, { "selector": "objectLiteralProperty", "format": null }, { "selector": ["classProperty", "parameter"], "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow" }, { "selector": ["typeLike", "enumMember"], "format": ["PascalCase"] }],
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
"@typescript-eslint/object-curly-spacing": ["error", "always", { "arraysInObjects": false }],
"@typescript-eslint/quotes": ["error", "double", { "allowTemplateLiterals": true }],
"@typescript-eslint/restrict-plus-operands": ["error", { "allowAny": true }],
"@typescript-eslint/restrict-template-expressions": ["error", { "allowAny": true, "allowBoolean": true, "allowNumber": true, "allowRegExp": true }],
"@typescript-eslint/return-await": ["error", "in-try-catch"],
"@typescript-eslint/space-before-function-paren": ["error", { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
"array-bracket-newline": ["error", "consistent"],
"array-element-newline": ["error", "consistent"],
"dot-location": ["error", "property"],
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"function-call-argument-newline": ["error", "consistent"],
"function-paren-newline": ["error", "consistent"],
"id-length": ["error", { "exceptions": ["_", "x", "y", "z"] }],
"multiline-ternary": ["error", "never"],
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"no-tabs": ["error", { "allowIndentationTabs": true }],
"no-useless-rename": ["error", { "ignoreDestructuring": true }],
"object-property-newline": ["error", { "allowAllPropertiesOnSameLine": true }],
"object-shorthand": ["error", "never"],
"one-var": ["error", "never"],
"padded-blocks": ["error", "never"],
"prefer-const": ["error", { "destructuring": "all" }],
"prefer-destructuring": ["error", { "AssignmentExpression": { "array": false, "object": false }}],
"radix": ["error", "as-needed"],
"sort-imports": ["error", { "allowSeparatedGroups": true, "ignoreDeclarationSort": true }],
"wrap-iife": ["error", "inside"],
// Warn
"@typescript-eslint/no-extra-parens": "warn",
"@typescript-eslint/no-loop-func": "warn",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-use-before-define": "warn",
"max-depth": ["warn", { "max": 5 }],
"max-params": ["warn", { "max": 5 }],
"max-statements-per-line": "warn",
"no-continue": "warn",
"sort-keys": "warn",
"sort-vars": "warn",
// Unsure
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"require-atomic-updates": "off",
// Disabled
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/init-declarations": "off",
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-type-alias": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/prefer-readonly": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/sort-type-union-intersection-members": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"capitalized-comments": "off",
"class-methods-use-this": "off",
"consistent-return": "off",
"default-case-last": "off",
"func-names": "off",
"line-comment-position": "off",
"linebreak-style": "off",
"max-classes-per-file": "off",
"max-len": "off",
"max-lines-per-function": "off",
"max-statements": "off",
"multiline-comment-style": "off",
"new-cap": "off",
"newline-per-chained-call": "off",
"no-async-promise-executor": "off",
"no-await-in-loop": "off",
"no-console": "off",
"no-else-return": "off",
"no-fallthrough": "off",
"no-inline-comments": "off",
"no-negated-condition": "off",
"no-param-reassign": "off",
"no-ternary": "off",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-warning-comments": "off",
"prefer-arrow-callback": "off",
"prefer-named-capture-group": "off",
"prefer-template": "off",
"spaced-comment": "off",
"wrap-regex": "off"
}
}