-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
84 lines (74 loc) · 1.85 KB
/
eslint.config.js
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
// eslint.config.js
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';
import pluginPrettier from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
import pluginNuxt from 'eslint-plugin-nuxt';
import VueRules from './.eslint.config/vueRules.js';
/** @type {import('eslint').Linter.Config[]} */
export default [
{
ignores: [
'node_modules',
'dist',
'build',
'coverage',
'public',
'test',
'pnpm-lock.yaml',
'yarn.lock',
'package-lock.json',
'tsconfig.json',
'vue.config.js',
'.nuxt/*',
'.vscode/*',
'.idea/*',
],
},
// Apply to all relevant file types
{ files: ['**/*.{js,mjs,cjs,ts,vue}'] },
// Define global variables
{
languageOptions: {
globals: { ...globals.browser, ...globals.node },
},
},
// ESLint recommended rules
pluginJs.configs.recommended,
// TypeScript ESLint recommended rules
...tseslint.configs.recommended,
// Vue essential rules
...pluginVue.configs['flat/essential'],
// Integrate Prettier plugin
{
plugins: {
prettier: pluginPrettier,
},
rules: {
'prettier/prettier': 'error', // Show Prettier errors as ESLint errors
},
},
// Apply eslint-config-prettier to disable conflicting ESLint rules
prettierConfig,
// Specific configurations for .vue files
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: { parser: tseslint.parser },
},
plugins: {
nuxt: pluginNuxt, // Add the Nuxt plugin
},
rules: VueRules,
},
{
rules: {
'vue/multi-word-component-names': 'off',
// Disable other specific rules as needed
'no-console': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
];