-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
56 lines (55 loc) · 1.8 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
53
54
55
56
import globals from "globals";
import pluginJs from "@eslint/js";
import unusedImports from "eslint-plugin-unused-imports";
import sonarjs from "eslint-plugin-sonarjs";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
export default [
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
sonarjs.configs.recommended,
{
plugins: {
"unused-imports": unusedImports,
},
},
{
ignores: ["contrib/", "build/", "docs/static/"],
},
eslintPluginUnicorn.configs["flat/recommended"],
{
rules: {
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"unicorn/better-regex": "warn",
"unicorn/filename-case": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-lonely-if": "off",
"unicorn/prefer-module": "off",
"unicorn/numeric-separators-style": "warn",
"unicorn/prefer-number-properties": "warn",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-reduce": "off",
"unicorn/no-null": "off",
"unicorn/no-array-method-this-argument": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/no-anonymous-default-export": "off",
"unicorn/no-this-assignment": "off",
"unicorn/prefer-top-level-await": "off",
"unicorn/prefer-at": "off",
"sonarjs/no-duplicate-string": "off",
"prefer-arrow-callback": "warn",
"arrow-body-style": ["warn", "as-needed"],
"object-shorthand": ["error", "always", { avoidExplicitReturnArrows: true }],
"no-var": "error",
"prefer-const": "error",
},
},
];