-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
52 lines (51 loc) · 1.5 KB
/
eslint.config.mjs
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
import eslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import unusedImports from "eslint-plugin-unused-imports";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config({
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintPluginUnicorn.configs["flat/recommended"],
eslintConfigPrettier,
],
languageOptions: {
globals: globals.node,
},
files: ["src/**/*.ts"],
plugins: {
"unused-imports": unusedImports,
},
rules: {
"no-console": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"arrow-body-style": ["error", "as-needed"],
"no-constructor-return": "error",
"no-duplicate-imports": "error",
"no-self-compare": "error",
"no-else-return": "error",
"no-lonely-if": "error",
"no-negated-condition": "error",
"no-useless-return": "error",
"no-var": "error",
"operator-assignment": ["error", "always"],
"prefer-arrow-callback": "error",
"unicorn/no-array-reduce": "off",
},
});