-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
66 lines (62 loc) · 1.54 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
59
60
61
62
63
64
65
66
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import typescriptESLintParser from "@typescript-eslint/parser";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
});
export default [
eslintConfigPrettier,
eslintPluginPrettierRecommended,
{
ignores: [
".direnv/*",
".devenv/*",
".bingo/*",
".github/*",
"cmd/*",
"pkg/*",
"static/*",
"src/client/*",
],
},
{
languageOptions: {
globals: {
process: true,
module: true,
require: true,
},
},
linterOptions: {
reportUnusedDisableDirectives: "error",
},
},
js.configs.recommended,
...compat
.extends("plugin:@typescript-eslint/recommended")
.map(({ ...config }) => config),
{
files: ["**/*.{js,ts,mjs,cjs}"],
},
...compat.extends("plugin:vue/vue3-recommended").map((config) => {
return {
...config,
files: ["**/*.vue"],
languageOptions: {
...config.languageOptions,
parserOptions: {
...config.languageOptions?.parserOptions,
parser: typescriptESLintParser,
},
},
};
}),
...compat.extends("eslint-config-prettier"),
];