Skip to content

Commit 1484c49

Browse files
committed
fix subRoutes case typo
1 parent 64a425a commit 1484c49

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

rules/vue-router/subroutes.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
var chalk = require('chalk')
44

55
module.exports = {
6-
pattern: /\bsubroutes\s*?:/,
6+
pattern: /\bsubRoutes\s*?:/,
77
warning: function (match) {
88
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',
1010
fix: (
11-
'Replace ' + chalk.red('subroutes') + ' with ' +
11+
'Replace ' + chalk.red('subRoutes') + ' with ' +
1212
chalk.green('children') +
1313
' and update its routes to the new array syntax'
1414
),
15-
docsHash: 'subroutes-deprecated'
15+
docsHash: 'subRoutes-deprecated'
1616
}
1717
}
1818
}

rules/vue-router/subroutes.spec.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,25 @@ describe('Rule: subroutes', () => {
1313
expect(warning).toBe(null)
1414
})
1515

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')
1920
})
2021

21-
it('matches "subroutes:"', () => {
22+
it('matches "subRoutes:"', () => {
2223
const warning = check(`
23-
subroutes:
24+
subRoutes:
2425
`)
2526
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')
2728
})
2829

29-
it('matches "subroutes :"', () => {
30+
it('matches "subRoutes :"', () => {
3031
const warning = check(`
31-
subroutes :
32+
subRoutes :
3233
`)
3334
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')
3536
})
3637
})

0 commit comments

Comments
 (0)