Skip to content

Extended Vue and Vuex version checks from Vue v2 to v9 and Vuex v1 to v9 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rules/vue/vue-dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var chalk = require('chalk')

module.exports = {
pattern: /("vue"\s*:\s*)"[^\d"]*?[^2]\.\d+\.\d+"/,
pattern: /("vue"\s*:\s*)"[^\d"]*?[^2-9]\.\d+\.\d+"/,
warning: function (match, preVersion) {
return {
reason: 'If you are using pre-2.0 Vue through NPM, you have to update it in your package.json file',
Expand Down
14 changes: 14 additions & 0 deletions rules/vue/vue-dependency.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ describe('Rule: vue-dependency', () => {
expect(warning).toBe(null)
})

it('is not limited to pre 3.0 versions', () => {
const warning = check(`
"vue": "3.0.0"
`)
expect(warning).toBe(null)
})

it('is not limited to pre 3.0 versions, with comma', () => {
const warning = check(`
"vue": "3.0.0",
`)
expect(warning).toBe(null)
})

it('does not match vuex "1.0.0"', () => {
const warning = check(`
"vuex": "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion rules/vuex/vuex-dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var chalk = require('chalk')

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