-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
53 lines (52 loc) · 1.51 KB
/
eslint.config.mjs
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
import { defineFlatConfig } from 'eslint-define-config';
import vuePlugin from 'eslint-plugin-vue';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import parser from 'vue-eslint-parser';
import tsParser from '@typescript-eslint/parser';
import globals from 'globals';
import prettierConfig from 'eslint-config-prettier';
export default defineFlatConfig([
{
files: ['**/*.{js,ts,vue}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: parser, // Usando o parser Vue
parserOptions: {
parser: tsParser, // Define o TypeScript parser para <script lang="ts">
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
},
plugins: {
vue: vuePlugin,
'@typescript-eslint': tsPlugin,
},
rules: {
...vuePlugin.configs['vue3-recommended'].rules,
...tsPlugin.configs['recommended'].rules,
...prettierConfig.rules,
'vue/component-tags-order': [
'error',
{
order: ['template', 'script', 'style'],
},
],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
'vue/no-v-html': 'off',
'vue/padding-line-between-blocks': ['error', 'always'],
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
},
]);