-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
111 lines (103 loc) · 2.81 KB
/
.eslintrc.js
File metadata and controls
111 lines (103 loc) · 2.81 KB
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
module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
ecmaFeatures: {
modules: true,
},
},
env: {
browser: true,
jquery: true,
node: true,
'vue/setup-compiler-macros': true
},
extends: [
'eslint:recommended',
'standard',
'plugin:import/errors',
'plugin:vue/recommended',
'plugin:prettier-vue/recommended',
'prettier',
],
settings: {
'prettier-vue': {
// Settings for how to process Vue SFC Blocks
SFCBlocks: {
template: true,
script: true,
style: true,
customBlocks: {
// Treat the `<docs>` block as a `.markdown` file
docs: { lang: 'markdown' },
// Treat the `<config>` block as a `.json` file
config: { lang: 'json' },
// Treat the `<module>` block as a `.js` file
module: { lang: 'js' },
// Ignore `<comments>` block (omit it or set it to `false` to ignore the block)
comments: false,
// Other custom blocks that are not listed here will be ignored
},
},
// Use prettierrc for prettier options or not (default: `true`)
usePrettierrc: true,
// Set the options for `prettier.getFileInfo`.
// @see https://prettier.io/docs/en/api.html#prettiergetfileinfofilepath-options
fileInfoOptions: {
// Path to ignore file (default: `'.prettierignore'`)
// Notice that the ignore file is only used for this plugin
ignorePath: '.testignore',
// Process the files in `node_modules` or not (default: `false`)
withNodeModules: false,
},
},
},
rules: {
'import/no-unresolved': 'off',
'import/extensions': 'off',
'prefer-arrow-callback': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-object-spread': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'no-duplicate-imports': 'error',
'object-shorthand': 'error',
// VUE
'vue/html-self-closing': [
'error',
{
html: { normal: 'never', void: 'always' },
svg: 'always',
math: 'always',
},
],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{
ignores: ['b-*'],
},
],
'vue/multi-word-component-names': 'off',
'vue/no-v-html': 'off',
'prettier-vue/prettier': [
'error',
{
// Override all options of `prettier` here
// @see https://prettier.io/docs/en/options.html
printWidth: 125,
singleQuote: true,
semi: false,
trailingComma: 'none',
arrowParens: 'avoid',
htmlWhitespaceSensitivity: 'ignore',
},
],
},
overrides: [
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
},
],
}