-
-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy patheslint.config.mjs
More file actions
93 lines (81 loc) 路 2.87 KB
/
Copy patheslint.config.mjs
File metadata and controls
93 lines (81 loc) 路 2.87 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import eslint from "@eslint/js";
import { globalIgnores } from "eslint/config";
import { includeIgnoreFile } from "@eslint/compat";
import compat from "eslint-plugin-compat";
import vuePlugin from "eslint-plugin-vue";
import {
configureVueProject,
defineConfigWithVueTs,
vueTsConfigs,
} from "@vue/eslint-config-typescript";
// import vueA11yPlugin from "eslint-plugin-vuejs-accessibility";
import skipFormattingConfig from "@vue/eslint-config-prettier/skip-formatting";
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");
configureVueProject({
rootDir: import.meta.dirname, // monorepo root
includeDotFolders: true,
});
export default defineConfigWithVueTs([
// define specific ignore patterns
globalIgnores([
"*.d.ts",
// prevent lint for generated files
"CHANGELOG.md",
"**/packages/oruga/src/config.d.ts",
"**/packages/oruga/src/globals.d.ts",
"**/theme-*.md",
]),
// include .gitignore ignore patterns
includeIgnoreFile(gitignorePath),
// add browser compatibility configs
compat.configs["flat/recommended"],
// add js configs
eslint.configs.recommended,
// add vue with ts configs
vuePlugin.configs["flat/recommended"],
vueTsConfigs.recommendedTypeChecked,
// add vue a11y configs
// ...vueA11yPlugin.configs["flat/recommended"],
// add vue prettier lint configs
// deactivate prettier lint checks as recommended at https://github.com/vuejs/eslint-config-prettier?tab=readme-ov-file#use-separate-commands-for-linting-and-formatting
// instead, we do formatting as a separate prettier task
skipFormattingConfig,
// project modifications
{
name: "overrides",
rules: {
// TypeScript
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": [
"warn",
{ typesToIgnore: ["ModelValue", "T"] },
],
"@typescript-eslint/restrict-template-expressions": "off",
// Vue
"vue/padding-line-between-blocks": ["error", "always"],
"vue/multi-word-component-names": "off",
"vue/no-empty-component-block": "error",
"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",
},
},
],
},
},
]);