-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
64 lines (57 loc) · 1.48 KB
/
eslint.config.mjs
File metadata and controls
64 lines (57 loc) · 1.48 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
// eslint.config.mjs
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import vue from 'eslint-plugin-vue';
import vueParser from 'vue-eslint-parser';
import globals from 'globals';
import prettier from 'eslint-config-prettier';
export default [
// Ignorar rutas comunes
{
ignores: [
'**/node_modules/**',
'**/.yarn/**',
'**/dist/**',
'**/public/**',
'**/publico/**',
'**/coverage/**',
'**/.vite/**',
],
},
// Base JS
{
files: ['**/*.{js,cjs,mjs,ts,tsx,vue}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: { ...globals.browser, ...globals.node },
},
},
// Reglas recomendadas JS
js.configs.recommended,
// Vue (flat config)
// Nota: esta config aplica a *.vue y ya usa vue-eslint-parser
// Luego abajo reforzamos el parser TS dentro de <script lang="ts">
...vue.configs['flat/recommended'],
// TypeScript (sin type-check para rapidez)
...tseslint.configs.recommended,
// Asegurar parser TS dentro de SFC
{
files: ['**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
// Hace que <script lang="ts"> use el parser de TS
parser: tseslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
extraFileExtensions: ['.vue'],
},
},
rules: {
'vue/multi-word-component-names': 'off',
},
},
// Desactivar reglas que chocan con Prettier
prettier,
];