eslint.config.mjs
2.01 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
import antfu from "@antfu/eslint-config";
export default antfu({
// Type of the project. 'lib' for libraries, the default is 'app'
type: "app",
rules: {
"antfu/if-newline": 0,
"antfu/curly": 0,
},
// Enable stylistic formatting rules
// stylistic: true,
// Or customize the stylistic rules
stylistic: {
indent: 2, // 4, or 'tab'
semi: true,
stylistic: true,
quotes: "double", // 'single' or 'double'
},
// TypeScript and Vue are autodetected, you can also explicitly enable them:
typescript: true,
vue: true,
// Disable jsonc and yaml support
jsonc: false,
markdown: false,
yaml: false,
// `.eslintignore` is no longer supported in Flat config, use `ignores` instead
ignores: [
"**/fixtures",
"**/.cache",
"**/.data",
"**/.gitignore",
"**/.env",
"**/.env.dist",
"**/.output",
"**/.nitro",
"**/.nuxt",
"**/assets",
"**/dist",
"**/logs",
"**/node_modules",
"**/public",
"**/server",
],
});
// Ancienne config eslint.
// import withNuxt from "./.nuxt/eslint.config.mjs";
// import js from "@eslint/js";
// import eslintPluginVue from "eslint-plugin-vue";
// import ts from "typescript-eslint";
//
// const TsConfigRecommended = ts.configs.recommended;
//
// export default withNuxt(
// // Your custom configs here
// js.configs.recommended,
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-expect-error
// ...TsConfigRecommended,
// ...eslintPluginVue.configs["flat/recommended"],
// {
// files: ["*.vue", "**/*.vue"],
// languageOptions: {
// parserOptions: {
// parser: "@typescript-eslint/parser",
// },
// },
// rules: {
// "vue/multi-word-component-names": "off",
// },
// },
// // your custom flat configs go here, for example:
// // {
// // files: ['**/*.ts', '**/*.tsx'],
// // rules: {
// // 'no-console': 'off' // allow console.log in TypeScript files
// // }
// // },
// // {
// // ...
// // }
// );