-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
43 lines (39 loc) · 1.25 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
import { FlatCompat } from "@eslint/eslintrc";
import { dirname } from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.config({
extends: ["next/core-web-vitals", "next/typescript"],
rules: {
"no-alert": "warn",
"no-console": "warn",
"no-constant-condition": "error",
"no-debugger": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-unreachable": "error",
"use-isnan": "error",
eqeqeq: ["error", "smart"],
"no-eval": "error",
"no-floating-decimal": "error",
"no-new": "error",
"no-return-assign": "error",
"no-self-compare": "error",
"no-undef-init": "error",
"no-var": "error",
"no-unused-vars": "error",
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", { before: false, after: true }],
"comma-style": ["error", "last"],
"new-parens": "error",
"no-multiple-empty-lines": ["error", { max: 2, maxEOF: 1 }],
quotes: ["error", "double", { avoidEscape: true }],
},
}),
];
export default eslintConfig;