-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
62 lines (54 loc) · 1.68 KB
/
eslint.config.mjs
File metadata and controls
62 lines (54 loc) · 1.68 KB
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
import eslint from "@eslint/js";
import { globalIgnores } from "eslint/config";
import { includeIgnoreFile } from "@eslint/compat";
import vuePlugin from "eslint-plugin-vue";
import {
defineConfigWithVueTs,
vueTsConfigs,
} from "@vue/eslint-config-typescript";
import prettierConfig from "@vue/eslint-config-prettier";
import { fileURLToPath } from "node:url";
import path from "node:path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, ".gitignore");
export default [
// define specific ignore patterns
globalIgnores(["*.d.ts"]),
// include .gitignore ignore patterns
includeIgnoreFile(gitignorePath),
// add js configs
eslint.configs.recommended,
// add vue with ts configs
...defineConfigWithVueTs(
vuePlugin.configs["flat/recommended"],
vueTsConfigs.recommended,
),
// add prettier configs
prettierConfig,
// your modifications
{
rules: {
// TypeScript
"@typescript-eslint/no-explicit-any": ["warn"],
"@typescript-eslint/ban-ts-comment": ["warn"],
"@typescript-eslint/explicit-function-return-type": ["warn"],
// Vue
"vue/padding-line-between-blocks": ["error", "always"],
"vue/multi-word-component-names": ["off"],
"vue/block-order": ["error", { order: ["script", "template", "style"] }],
"vue/block-lang": ["error", { script: { lang: "ts" } }],
"vue/html-closing-bracket-newline": [
"error",
{
singleline: "never",
multiline: "never",
selfClosingTag: {
singleline: "never",
multiline: "never",
},
},
],
},
},
];