File tree 5 files changed +27
-14
lines changed
cli-plugin-eslint/__tests__
5 files changed +27
-14
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,23 @@ test('standard', async () => {
48
48
expect ( pkg . devDependencies ) . toHaveProperty ( '@vue/eslint-config-standard' )
49
49
} )
50
50
51
+ test ( 'prettier' , async ( ) => {
52
+ const { pkg } = await generateWithPlugin ( {
53
+ id : 'eslint' ,
54
+ apply : require ( '../generator' ) ,
55
+ options : {
56
+ config : 'prettier'
57
+ }
58
+ } )
59
+
60
+ expect ( pkg . scripts . lint ) . toBeTruthy ( )
61
+ expect ( pkg . eslintConfig ) . toEqual ( {
62
+ extends : [ 'plugin:vue/essential' , '@vue/prettier' ]
63
+ } )
64
+ expect ( pkg . devDependencies ) . toHaveProperty ( 'eslint-plugin-vue' )
65
+ expect ( pkg . devDependencies ) . toHaveProperty ( '@vue/eslint-config-prettier' )
66
+ } )
67
+
51
68
test ( 'lint on save' , async ( ) => {
52
69
const { pkg } = await generateWithPlugin ( {
53
70
id : 'eslint' ,
@@ -77,7 +94,3 @@ test('lint on commit', async () => {
77
94
'*.vue' : [ 'vue-cli-service lint' , 'git add' ]
78
95
} )
79
96
} )
80
-
81
- test ( 'prettier' , async ( ) => {
82
- // TODO
83
- } )
Original file line number Diff line number Diff line change @@ -31,12 +31,12 @@ module.exports = cli => {
31
31
name : 'ESLint + Standard config' ,
32
32
value : 'standard' ,
33
33
short : 'Standard'
34
+ } ,
35
+ {
36
+ name : 'ESLint + Prettier' ,
37
+ value : 'prettier' ,
38
+ short : 'Prettier'
34
39
}
35
- // {
36
- // name: 'ESLint + Prettier',
37
- // value: 'prettier',
38
- // short: 'Prettier'
39
- // }
40
40
]
41
41
} )
42
42
Original file line number Diff line number Diff line change @@ -4,6 +4,6 @@ module.exports = {
4
4
require . resolve ( 'eslint-config-prettier' )
5
5
] ,
6
6
rules : {
7
- 'prettier/prettier' : 'error '
7
+ 'prettier/prettier' : 'warn '
8
8
}
9
9
}
Original file line number Diff line number Diff line change 22
22
"homepage" : " https://github.com/vuejs/vue-cli/packages/@vue/eslint-config-prettier#readme" ,
23
23
"dependencies" : {
24
24
"eslint-config-prettier" : " ^2.9.0" ,
25
- "eslint-plugin-prettier" : " ^2.4 .0" ,
25
+ "eslint-plugin-prettier" : " ^2.5 .0" ,
26
26
"prettier" : " ^1.10.2"
27
27
}
28
28
}
Original file line number Diff line number Diff line change @@ -3221,9 +3221,9 @@ eslint-plugin-node@^5.2.1:
3221
3221
resolve "^1.3.3"
3222
3222
semver "5.3.0"
3223
3223
3224
- eslint-plugin-prettier@^2.4 .0 :
3225
- version "2.4 .0"
3226
- resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.%3Cspan%20class="x x-first x-last">4 .0.tgz#85cab0775c6d5e3344ef01e78d960f166fb93aae "
3224
+ eslint-plugin-prettier@^2.5 .0 :
3225
+ version "2.5 .0"
3226
+ resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.%3Cspan%20class="x x-first x-last">5 .0.tgz#39a91dd7528eaf19cd42c0ee3f2c1f684606a05f "
3227
3227
dependencies :
3228
3228
fast-diff "^1.1.1"
3229
3229
jest-docblock "^21.0.0"
You can’t perform that action at this time.
0 commit comments