-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.eslintrc.js
112 lines (108 loc) · 2.55 KB
/
.eslintrc.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
module.exports = {
env: {
browser: true,
node: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/recommended',
],
parserOptions: {
parser: '@typescript-eslint/parser',
project: './tsconfig.json',
extraFileExtensions: ['.vue'],
},
plugins: ['vue'],
rules: {
'max-len': [
'error',
{
code: 100,
// Fixes errors in HTML files with long links
ignoreUrls: true,
},
],
// Disable stylistic rules that interfere with Prettier
'vue/html-closing-bracket-newline': 'off',
'vue/html-self-closing': 'off',
'vue/max-attributes-per-line': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/html-indent': 'off',
'vue/multi-word-component-names': ['off'],
// This rule is for Vue3, and Gridsome uses Vue2
'vue/no-deprecated-filter': ['off'],
// Don't make <g-link> multiline, it adds spaces
'vue/multiline-html-element-content-newline': [
'error',
{
ignores: [
'g-link',
// Original inline elements from: https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/utils/inline-non-void-elements.json
'a',
'abbr',
'audio',
'b',
'bdi',
'bdo',
'canvas',
'cite',
'code',
'data',
'del',
'dfn',
'em',
'i',
'iframe',
'ins',
'kbd',
'label',
'map',
'mark',
'noscript',
'object',
'output',
'picture',
'q',
'ruby',
's',
'samp',
'small',
'span',
'strong',
'sub',
'sup',
'svg',
'time',
'u',
'var',
'video',
],
},
],
'@typescript-eslint/indent': ['error', 2],
semi: ['error', 'always'],
'arrow-parens': ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowHigherOrderFunctions: true,
allowTypedFunctionExpressions: true,
},
],
},
overrides: [
{
files: ['*.vue', 'declarations/*.ts'],
rules: {
indent: 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-var-requires': 0,
},
},
],
};