-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
58 lines (57 loc) · 1.76 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
57
58
import pluginJs from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginImport from "eslint-plugin-import";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import unusedImports from "eslint-plugin-unused-imports";
import globals from "globals";
export default [
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
eslintConfigPrettier,
{
files: ["**/*.{js,mjs,cjs,ts}"],
},
{
plugins: {
"simple-import-sort": simpleImportSort,
import: eslintPluginImport,
"unused-imports": unusedImports,
},
rules: {
"no-unused-vars": "off",
"no-undef": "error",
"no-console": "warn",
"prefer-const": "error",
"arrow-body-style": ["error", "as-needed"],
"capitalized-comments": ["error", "always"],
curly: ["error", "multi-or-nest"],
eqeqeq: ["error", "always"],
"prefer-template": "error",
"no-unneeded-ternary": "error",
"no-unreachable-loop": "error",
"no-use-before-define": "error",
"no-useless-assignment": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-throw-literal": "error",
// Plugins configuration
// Simple-import-sort
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
// Eslint-plugin-import
"import/first": "error",
"import/no-duplicates": "error",
// Unused-imports
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
},
},
];