-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.js
59 lines (51 loc) · 1.73 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
/* eslint-env node */
// import '@rushstack/eslint-patch/modern-module-resolution.js';
import { includeIgnoreFile } from '@eslint/compat'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const gitignorePath = path.resolve(__dirname, '.gitignore')
import js from '@eslint/js'
import pluginVue from 'eslint-plugin-vue'
import vueParser from 'vue-eslint-parser'
import tseslint from 'typescript-eslint'
export default [
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...pluginVue.configs['flat/recommended'],
...tseslint.configs.recommended,
{
files: ['**/*.vue', '**/*.js'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }]
}
},
{
files: ['**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: '@typescript-eslint/parser'
}
},
rules: {
'vue/block-order': ['error', { order: ['template', 'script', 'style'] }],
// there can only be 3 vue attributes per line: after that we must unfold
'vue/attribute-hyphenation': ['warn', 'never'],
'vue/custom-event-name-casing': ['warn', 'kebab-case'],
'vue/singleline-html-element-content-newline': 'off',
'vue/require-default-prop': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-undef-components': ['error', {}],
// WIP: To fix in #97
'vue/no-v-html': 'off',
// Prettier compatibility
'vue/max-attributes-per-line': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/html-indent': 'off',
'vue/html-self-closing': 'off'
}
}
]