-
-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy patheslint.config.mjs
More file actions
129 lines (113 loc) · 3.68 KB
/
eslint.config.mjs
File metadata and controls
129 lines (113 loc) · 3.68 KB
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
import { defineConfig } from "eslint/config";
import globals from "globals";
import js from "@eslint/js";
import n from "eslint-plugin-n";
import unicorn from "eslint-plugin-unicorn";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";
export default defineConfig([
js.configs.recommended,
n.configs["flat/recommended"],
unicorn.configs.recommended,
tseslint.configs.recommended,
eslintConfigPrettier,
{
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
eqeqeq: [2, "smart"],
"no-caller": 2,
"dot-notation": 2,
"no-var": 2,
"prefer-const": 2,
"prefer-arrow-callback": [
2,
{
allowNamedFunctions: true,
},
],
"arrow-body-style": [2, "as-needed"],
"object-shorthand": 2,
"prefer-template": 2,
"one-var": [2, "never"],
"prefer-destructuring": [
2,
{
object: true,
},
],
"capitalized-comments": 2,
"multiline-comment-style": [2, "starred-block"],
"spaced-comment": 2,
yoda: [2, "never"],
curly: [2, "multi-line"],
"no-else-return": 2,
"n/no-unpublished-import": 0,
"unicorn/filename-case": [
2,
{
cases: {
camelCase: true,
pascalCase: true,
},
},
],
"unicorn/no-null": 0,
"unicorn/prefer-code-point": 0,
"unicorn/prefer-string-slice": 0,
"unicorn/prefer-add-event-listener": 0,
"unicorn/prefer-at": 0,
"unicorn/prefer-string-replace-all": 0,
},
},
{
files: ["**/*.ts"],
languageOptions: {
sourceType: "module",
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
},
},
rules: {
curly: [2, "multi-line"],
"@typescript-eslint/prefer-for-of": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-use-before-define": [
2,
{
functions: false,
},
],
"@typescript-eslint/consistent-type-definitions": [2, "interface"],
"@typescript-eslint/prefer-function-type": 2,
"@typescript-eslint/no-unnecessary-type-arguments": 2,
"@typescript-eslint/prefer-string-starts-ends-with": 2,
"@typescript-eslint/prefer-readonly": 2,
"@typescript-eslint/prefer-includes": 2,
"@typescript-eslint/no-unnecessary-condition": 2,
"@typescript-eslint/switch-exhaustiveness-check": 2,
"@typescript-eslint/prefer-nullish-coalescing": 2,
"@typescript-eslint/consistent-type-imports": [
2,
{
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/consistent-type-exports": 2,
"n/no-missing-import": 0,
"n/no-unsupported-features/es-syntax": 0,
},
},
{
files: ["**/*.spec.ts"],
rules: {
"n/no-unsupported-features/node-builtins": 0,
},
},
]);