UNPKG

3.5 kBJavaScriptView Raw
1module.exports = {
2 parser: "@typescript-eslint/parser",
3 extends: ["plugin:import/typescript", "prettier"],
4 plugins: ["@typescript-eslint"],
5 parserOptions: {
6 warnOnUnsupportedTypeScriptVersion: false,
7 sourceType: "module",
8 jsx: true,
9 },
10 rules: {
11 "@typescript-eslint/await-thenable": "error",
12 "dot-notation": "off",
13 "@typescript-eslint/dot-notation": ["error"],
14 "@typescript-eslint/naming-convention": [
15 "error",
16 {
17 selector: "default",
18 format: ["camelCase"],
19 },
20 {
21 selector: "variable",
22 format: ["camelCase", "UPPER_CASE"],
23 },
24 {
25 selector: "variable",
26 types: ["boolean"],
27 format: ["PascalCase"],
28 prefix: ["is", "should", "has", "can", "did", "will"],
29 },
30 {
31 selector: "parameter",
32 format: ["camelCase", "UPPER_CASE"],
33 leadingUnderscore: "allow",
34 },
35 {
36 selector: "typeLike",
37 format: ["PascalCase"],
38 },
39 ],
40 "@typescript-eslint/no-base-to-string": "error",
41 "@typescript-eslint/no-floating-promises": "error",
42 "@typescript-eslint/no-for-in-array": "error",
43 "@typescript-eslint/no-implied-eval": "error",
44 "@typescript-eslint/no-misused-promises": "error",
45 "@typescript-eslint/no-throw-literal": "off",
46 "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
47 "@typescript-eslint/no-unnecessary-condition": "error",
48 "@typescript-eslint/no-unnecessary-qualifier": "off",
49 "@typescript-eslint/no-unnecessary-type-arguments": "off",
50 "@typescript-eslint/no-unnecessary-type-assertion": "error",
51 "@typescript-eslint/no-unsafe-assignment": "error",
52 "@typescript-eslint/no-unsafe-call": "error",
53 "@typescript-eslint/no-unsafe-member-access": "error",
54 "@typescript-eslint/no-unsafe-return": "error",
55 "@typescript-eslint/prefer-includes": "error",
56 "@typescript-eslint/prefer-nullish-coalescing": [
57 "error",
58 {
59 ignoreConditionalTests: true,
60 ignoreMixedLogicalExpressions: true,
61 },
62 ],
63 "@typescript-eslint/prefer-readonly": "error",
64 "@typescript-eslint/prefer-readonly-parameter-types": "error",
65 "@typescript-eslint/prefer-regexp-exec": "error",
66 "@typescript-eslint/prefer-string-starts-ends-with": "error",
67 "@typescript-eslint/prefer-reduce-type-parameter": "error",
68 "@typescript-eslint/promise-function-async": [
69 "error",
70 {
71 allowedPromiseNames: [],
72 checkArrowFunctions: false,
73 checkFunctionDeclarations: false,
74 checkFunctionExpressions: false,
75 checkMethodDeclarations: true,
76 },
77 ],
78 "@typescript-eslint/require-array-sort-compare": "error",
79 "@typescript-eslint/require-await": "off",
80 "@typescript-eslint/return-await": "error",
81 "@typescript-eslint/restrict-plus-operands": "error",
82 "@typescript-eslint/restrict-template-expressions": [
83 "error",
84 {
85 allowNumber: true,
86 allowBoolean: false,
87 allowNullable: false,
88 },
89 ],
90 "@typescript-eslint/strict-boolean-expressions": "off",
91 "@typescript-eslint/switch-exhaustiveness-check": "error",
92 "@typescript-eslint/unbound-method": [
93 "error",
94 {
95 ignoreStatic: true,
96 },
97 ],
98 "@typescript-eslint/no-confusing-void-expression": "error",
99 "@typescript-eslint/no-unsafe-argument": "off",
100 "@typescript-eslint/non-nullable-type-assertion-style": "error",
101 },
102};