-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
/
Copy patheslintDeps.js
49 lines (43 loc) · 1.17 KB
/
eslintDeps.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
const DEPS_MAP = {
base: {
eslint: '^6.7.2',
'eslint-plugin-vue': '^6.2.2'
},
airbnb: {
'@vue/eslint-config-airbnb': '^5.0.2',
'eslint-plugin-import': '^2.20.2'
},
prettier: {
'@vue/eslint-config-prettier': '^6.0.0',
'eslint-plugin-prettier': '^3.1.3',
prettier: '^1.19.1'
},
standard: {
'@vue/eslint-config-standard': '^5.1.2',
'eslint-plugin-import': '^2.20.2',
'eslint-plugin-node': '^11.1.0',
'eslint-plugin-promise': '^4.2.1',
'eslint-plugin-standard': '^4.0.0'
},
typescript: {
'@vue/eslint-config-typescript': '^5.0.2',
'@typescript-eslint/eslint-plugin': '^2.33.0',
'@typescript-eslint/parser': '^2.33.0'
}
}
exports.DEPS_MAP = DEPS_MAP
exports.getDeps = function (api, preset, rootOptions = {}) {
const deps = Object.assign({}, DEPS_MAP.base, DEPS_MAP[preset])
if (rootOptions.vueVersion === '3') {
Object.assign(deps, { 'eslint-plugin-vue': '^7.0.0-0' })
}
if (api.hasPlugin('typescript')) {
Object.assign(deps, DEPS_MAP.typescript)
}
if (api.hasPlugin('babel') && !api.hasPlugin('typescript')) {
Object.assign(deps, {
'babel-eslint': '^10.1.0'
})
}
return deps
}