This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
generated from SWIC-Web-Dev/node-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
eslint.config.mjs
53 lines (50 loc) · 1.53 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
import pluginJs from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import globals from "globals";
export default [
pluginJs.configs.recommended,
{
languageOptions: {
globals: {
...globals.node,
},
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
// Node.js specific rules
"no-buffer-constructor": "error",
"no-path-concat": "error",
"no-process-exit": "error",
"no-sync": "warn",
// Modern JavaScript rules
"no-var": "error",
"prefer-const": "error",
"prefer-arrow-callback": "error",
"prefer-destructuring": ["error", { object: true, array: false }],
"prefer-rest-params": "error",
"prefer-spread": "error",
"no-useless-rename": "error",
"object-shorthand": "error",
"no-duplicate-imports": "error",
// Additional quality rules
eqeqeq: ["error", "always"],
"no-eval": "error",
"no-implied-eval": "error",
"no-return-await": "error",
"require-await": "error",
"no-use-before-define": [
"error",
{ functions: false, classes: true, variables: true },
],
"no-throw-literal": "error",
"prefer-promise-reject-errors": "error",
"no-useless-catch": "error",
"no-useless-return": "error",
"no-template-curly-in-string": "error",
"no-console": ["warn", { allow: ["warn", "error", "info"] }],
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
},
},
eslintConfigPrettier,
];