-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
69 lines (65 loc) · 1.49 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
import { FlatCompat } from '@eslint/eslintrc'
import path from 'path'
import { fileURLToPath } from 'url'
import js from '@eslint/js'
const dirname = path.dirname(fileURLToPath(import.meta.url))
const compat = new FlatCompat({
allConfig: js.configs.all,
baseDirectory: dirname,
recommendedConfig: js.configs.recommended,
resolvePluginsRelativeTo: dirname,
})
const config = {
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:nuxt/recommended',
'plugin:vue/vue3-strongly-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier-vue/recommended',
],
ignorePatterns: ['.nuxt'],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
parser: {
js: 'espree',
ts: '@typescript-eslint/parser',
},
sourceType: 'module',
},
plugins: ['vue', '@typescript-eslint'],
rules: {
'vue/multi-word-component-names': [
'error',
{
ignores: ['index'],
},
],
'prettier-vue/prettier': [
'error',
{
// Override all options of `prettier` here
// @see https://prettier.io/docs/en/options.html
printWidth: 80,
tabWidth: 1,
useTabs: true,
semi: false,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: true,
bracketSpacing: true,
bracketSameLine: false,
arrowParens: 'avoid',
vueIndentScriptAndStyle: false,
endOfLine: 'lf',
embeddedLanguageFormatting: 'auto',
singleAttributePerLine: true,
},
],
},
}
export default compat.config(config)