-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
49 lines (48 loc) · 1.28 KB
/
Copy patheslint.config.js
File metadata and controls
49 lines (48 loc) · 1.28 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
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
import globals from "globals";
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs["flat/recommended"],
// Browser globals for frontend Vue files
{
files: ["frontend/**/*.{vue,ts}"],
languageOptions: {
globals: globals.browser,
},
},
// Vue file TypeScript parser + relax opinionated formatting
{
files: ["**/*.vue"],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
"vue/max-attributes-per-line": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/html-self-closing": ["warn", { html: { void: "never" } }],
},
},
// Type-aware linting for TypeScript files
{
files: ["**/*.ts", "**/*.vue"],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: [".vue"],
},
},
rules: {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
},
},
{
ignores: ["public/", "node_modules/"],
}
);