UNPKG

4.05 kBJavaScriptView Raw
1module.exports = {
2 parser: "@typescript-eslint/parser",
3 extends: ["prettier/@typescript-eslint", "plugin:import/typescript"],
4 plugins: ["@typescript-eslint"],
5 parserOptions: {
6 warnOnUnsupportedTypeScriptVersion: false,
7 sourceType: "module",
8 jsx: true,
9 },
10 rules: {
11 "@typescript-eslint/adjacent-overload-signatures": "error",
12 "@typescript-eslint/array-type": ["error", { default: "array" }],
13 "@typescript-eslint/ban-types": [
14 "error",
15 {
16 types: {
17 Array: null,
18 Object: {
19 message: "Use `object` instead",
20 fixWith: "object",
21 },
22 object: "Use `{}` instead",
23 String: {
24 message: "Use `string` instead",
25 fixWith: "string",
26 },
27 Number: {
28 message: "Use `number` instead",
29 fixWith: "number",
30 },
31 BigInt: {
32 message: "Use `bigint` instead",
33 fixWith: "bigint",
34 },
35 Boolean: {
36 message: "Use `boolean` instead",
37 fixWith: "boolean",
38 },
39 },
40 },
41 ],
42 "@typescript-eslint/ban-ts-ignore": "off",
43 "brace-style": "off",
44 "@typescript-eslint/brace-style": [
45 "error",
46 "1tbs",
47 { allowSingleLine: true },
48 ],
49 camelcase: "off",
50 "@typescript-eslint/camelcase": "off",
51 "@typescript-eslint/class-name-casing": "error",
52 "@typescript-eslint/consistent-type-assertions": "error",
53 "@typescript-eslint/consistent-type-definitions": ["error", "type"],
54 "@typescript-eslint/explicit-function-return-type": "off",
55 "@typescript-eslint/explicit-member-accessibility": "off",
56 "@typescript-eslint/func-call-spacing": "off",
57 "@typescript-eslint/generic-type-naming": "off",
58 "@typescript-eslint/indent": "off",
59 "@typescript-eslint/interface-name-prefix": ["error", "never"],
60 "@typescript-eslint/member-delimiter-style": "off",
61 "@typescript-eslint/member-naming": [
62 "error",
63 {
64 public: "^[a-zA-Z]",
65 private: "^[a-zA-Z]",
66 protected: "^[a-zA-Z]",
67 },
68 ],
69 "@typescript-eslint/member-ordering": "off",
70 "@typescript-eslint/no-array-constructor": "error",
71 "no-empty-function": "off",
72 "@typescript-eslint/no-empty-function": "error",
73 "@typescript-eslint/no-empty-interface": "error",
74 "@typescript-eslint/no-explicit-any": "off",
75 "@typescript-eslint/no-extraneous-class": "error",
76 "@typescript-eslint/no-extra-parens": "off",
77 "@typescript-eslint/no-inferrable-types": "error",
78 "@typescript-eslint/no-magic-numbers": "off",
79 "@typescript-eslint/no-misused-new": "error",
80 "@typescript-eslint/no-namespace": "error",
81 "@typescript-eslint/no-non-null-assertion": "off",
82 "@typescript-eslint/no-parameter-properties": "error",
83 "@typescript-eslint/no-require-imports": "error",
84 "@typescript-eslint/no-this-alias": "error",
85 "@typescript-eslint/no-type-alias": "off",
86 "no-unused-vars": "off",
87 "@typescript-eslint/no-unused-vars": [
88 "error",
89 {
90 vars: "all",
91 args: "all",
92 ignoreRestSiblings: true,
93 argsIgnorePattern: "^_.*$",
94 caughtErrors: "all",
95 caughtErrorsIgnorePattern: "^_.*$",
96 },
97 ],
98 "no-use-before-define": "off",
99 "@typescript-eslint/no-use-before-define": "error",
100 "@typescript-eslint/no-useless-constructor": "error",
101 "@typescript-eslint/no-var-requires": "error",
102 "@typescript-eslint/prefer-for-of": "error",
103 "@typescript-eslint/prefer-function-type": "error",
104 "@typescript-eslint/prefer-namespace-keyword": "error",
105 quotes: "error",
106 "@typescript-eslint/quotes": "error",
107 "@typescript-eslint/semi": "off",
108 "@typescript-eslint/triple-slash-reference": [
109 "error",
110 { path: "never", types: "never", lib: "never" },
111 ],
112 "@typescript-eslint/typedef": "off",
113 "@typescript-eslint/type-annotation-spacing": "off",
114 "@typescript-eslint/unified-signatures": "off",
115 },
116};