-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.js
56 lines (53 loc) · 1.36 KB
/
vue.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
const { isPackageExists } = require('local-pkg');
const TS = isPackageExists('typescript');
if (!TS) {
console.warn('[@antoniogiroz/eslint-config] TypeScript is not installed, fallback to JS only.');
}
module.exports = {
overrides: [
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
'no-unused-vars': 'off',
'no-undef': 'off',
...(TS ? { '@typescript-eslint/no-unused-vars': 'off' } : null),
},
},
{
files: ['**/views/**/*.vue'],
rules: {
'vue/multi-word-component-names': 'off',
},
},
],
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
TS ? '@vue/eslint-config-typescript/recommended' : null,
'@vue/eslint-config-prettier',
TS ? './typescript' : './base',
],
rules: {
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
'vue/component-options-name-casing': ['error', 'PascalCase'],
'vue/custom-event-name-casing': ['error', 'camelCase'],
'vue/component-tags-order': [
'error',
{
order: ['script', 'template', 'style'],
},
],
'vue/block-tag-newline': [
'error',
{
singleline: 'always',
multiline: 'always',
},
],
'vue/no-useless-v-bind': 'error',
},
};