UNPKG

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