File tree 2 files changed +14
-13
lines changed
2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 3
3
var chalk = require ( 'chalk' )
4
4
5
5
module . exports = {
6
- pattern : / \b s u b r o u t e s \s * ?: / ,
6
+ pattern : / \b s u b R o u t e s \s * ?: / ,
7
7
warning : function ( match ) {
8
8
return {
9
- reason : 'subroutes has been renamed to children for consistency within Vue and with other routing libraries' ,
9
+ reason : 'subRoutes has been renamed to children for consistency within Vue and with other routing libraries' ,
10
10
fix : (
11
- 'Replace ' + chalk . red ( 'subroutes ' ) + ' with ' +
11
+ 'Replace ' + chalk . red ( 'subRoutes ' ) + ' with ' +
12
12
chalk . green ( 'children' ) +
13
13
' and update its routes to the new array syntax'
14
14
) ,
15
- docsHash : 'subroutes -deprecated'
15
+ docsHash : 'subRoutes -deprecated'
16
16
}
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -13,24 +13,25 @@ describe('Rule: subroutes', () => {
13
13
expect ( warning ) . toBe ( null )
14
14
} )
15
15
16
- it ( 'does not match "subroutes"' , ( ) => {
17
- const warning = check ( 'subroutes' )
18
- expect ( warning ) . toBe ( null )
16
+ it ( 'matches "subRoutes"' , ( ) => {
17
+ const warning = check ( 'subRoutes' )
18
+ expect ( warning ) . toBeTruthy ( )
19
+ expect ( warning . fix ) . toBe ( 'Replace subRoutes with children and update its routes to the new array syntax' )
19
20
} )
20
21
21
- it ( 'matches "subroutes :"' , ( ) => {
22
+ it ( 'matches "subRoutes :"' , ( ) => {
22
23
const warning = check ( `
23
- subroutes :
24
+ subRoutes :
24
25
` )
25
26
expect ( warning ) . toBeTruthy ( )
26
- expect ( warning . fix ) . toBe ( 'Replace subroutes with children and update its routes to the new array syntax' )
27
+ expect ( warning . fix ) . toBe ( 'Replace subRoutes with children and update its routes to the new array syntax' )
27
28
} )
28
29
29
- it ( 'matches "subroutes :"' , ( ) => {
30
+ it ( 'matches "subRoutes :"' , ( ) => {
30
31
const warning = check ( `
31
- subroutes :
32
+ subRoutes :
32
33
` )
33
34
expect ( warning ) . toBeTruthy ( )
34
- expect ( warning . fix ) . toBe ( 'Replace subroutes with children and update its routes to the new array syntax' )
35
+ expect ( warning . fix ) . toBe ( 'Replace subRoutes with children and update its routes to the new array syntax' )
35
36
} )
36
37
} )
You can’t perform that action at this time.
0 commit comments