Skip to content

Commit 17b3008

Browse files
ivuorinenchrisvfritz
authored andcommitted
Extended Vue and Vuex version checks from Vue v2 to v9 and Vuex v1 to v9 (#43)
1 parent 3dc64a9 commit 17b3008

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

rules/vue/vue-dependency.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var chalk = require('chalk')
44

55
module.exports = {
6-
pattern: /("vue"\s*:\s*)"[^\d"]*?[^2]\.\d+\.\d+"/,
6+
pattern: /("vue"\s*:\s*)"[^\d"]*?[^2-9]\.\d+\.\d+"/,
77
warning: function (match, preVersion) {
88
return {
99
reason: 'If you are using pre-2.0 Vue through NPM, you have to update it in your package.json file',

rules/vue/vue-dependency.spec.js

+14
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ describe('Rule: vue-dependency', () => {
3636
expect(warning).toBe(null)
3737
})
3838

39+
it('is not limited to pre 3.0 versions', () => {
40+
const warning = check(`
41+
"vue": "3.0.0"
42+
`)
43+
expect(warning).toBe(null)
44+
})
45+
46+
it('is not limited to pre 3.0 versions, with comma', () => {
47+
const warning = check(`
48+
"vue": "3.0.0",
49+
`)
50+
expect(warning).toBe(null)
51+
})
52+
3953
it('does not match vuex "1.0.0"', () => {
4054
const warning = check(`
4155
"vuex": "1.0.0"

rules/vuex/vuex-dependency.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var chalk = require('chalk')
44

55
module.exports = {
6-
pattern: /("vuex"\s*:\s*)"[^\d"]*?[^1-2]\.\d+\.\d+"/,
6+
pattern: /("vuex"\s*:\s*)"[^\d"]*?[^1-9]\.\d+\.\d+"/,
77
warning: function (match, preVersion) {
88
return {
99
reason: 'Vuex 1.0 is the earliest supported version compatible with Vue 2.0',

0 commit comments

Comments
 (0)