-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheslint.config.mjs
40 lines (39 loc) · 1001 Bytes
/
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
import eslint from "@eslint/js";
import prettier from "eslint-plugin-prettier";
import json from "eslint-plugin-json";
import globals from "globals";
export default [
{
files: ["**/*.json"],
...json.configs["recommended"],
...eslint.configs.recommended,
},
{
...eslint.configs.recommended,
files: ["**/*.{ts,js,json,mjs}"],
plugins: {
prettier,
},
languageOptions: {
globals: {
root: "off",
...globals.jest,
...globals.node,
...globals.es2021,
// ecmascriptVersion, and sourceType, default is right
},
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"prettier/prettier": [
"error",
{
usePrettierrc: true,
singleAttributePerLine: false,
},
],
},
},
];