-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
83 lines (81 loc) · 2.38 KB
/
eslint.config.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
const js = require("@eslint/js");
const { FlatCompat } = require("@eslint/eslintrc");
const compat = new FlatCompat({
// eslint-disable-next-line no-undef
baseDirectory: __dirname,
});
module.exports = [
js.configs.recommended,
...compat.config({
overrides: [
{
extends: [
"standard-with-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic",
"plugin:@typescript-eslint/stylistic-type-checked",
],
files: ["*.ts"],
rules: {
"@typescript-eslint/ban-types": [
"error",
{ extendDefaults: true, types: { "{}": false } },
],
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/member-ordering": [
"error",
{
default: {
memberTypes: [
"constructor",
"method",
"call-signature",
"set",
"get",
"field",
"signature",
],
optionalityOrder: "required-first",
order: "alphabetically-case-insensitive",
},
},
],
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/sort-type-constituents": "error",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{ allowNumber: false, allowString: false },
],
},
},
],
}),
{
rules: {
curly: "error",
"sort-imports": [
"error",
{
memberSyntaxSortOrder: ["none", "all", "single", "multiple"],
},
],
"sort-keys": "error",
"sort-vars": "error",
yoda: "off",
},
},
{
files: ["eslint.config.js"],
languageOptions: {
sourceType: "commonjs",
},
},
...compat.extends("plugin:prettier/recommended"),
];