Skip to content

Commit a37a3d3

Browse files
committed
Merge branch 'master' into script-indent/new
# Conflicts: # lib/rules/html-indent.js # tests/lib/rules/html-indent.js
2 parents 88130f7 + dfcd26e commit a37a3d3

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

Diff for: README.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66

77
> Official ESLint plugin for Vue.js
88
9-
## :exclamation: Attention - this is documentation for version `4.x` :exclamation:
10-
11-
This branch contains `eslint-plugin-vue@next` which is a pre-released `4.0`, but it's not the default version that you get with `npm install eslint-plugin-vue`. In order to install this you need to specify either `"eslint-plugin-vue": "next"` in `package.json` or do `npm install eslint-plugin-vue@next`.
12-
13-
Please try it and report any issues that you might have encountered.
14-
15-
If you want to check previous releases [go here](https://github.com/vuejs/eslint-plugin-vue/releases).
16-
179
## :art: Playground on the Web
1810

1911
You can try this plugin on the Web.
@@ -28,7 +20,7 @@ You can try this plugin on the Web.
2820
## :cd: Installation
2921

3022
```bash
31-
npm install --save-dev eslint eslint-plugin-vue@next
23+
npm install --save-dev eslint eslint-plugin-vue
3224
```
3325

3426
## :rocket: Usage

Diff for: lib/rules/no-side-effects-in-computed-properties.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function create (context) {
2727
// this.xxx.func()
2828
'CallExpression' (node) {
2929
const code = context.getSourceCode().getText(node)
30-
const MUTATION_REGEX = /(this.)((?!(concat|slice|map|filter)\().)*((push|pop|shift|unshift|reverse|splice|sort|copyWithin|fill)\()/g
30+
const MUTATION_REGEX = /(this.)((?!(concat|slice|map|filter)\().)[^\)]*((push|pop|shift|unshift|reverse|splice|sort|copyWithin|fill)\()/g
3131

3232
if (MUTATION_REGEX.test(code)) {
3333
forbiddenNodes.push(node)

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-vue",
3-
"version": "4.0.0-beta.4",
3+
"version": "4.0.0",
44
"description": "Official ESLint plugin for Vue.js",
55
"main": "lib/index.js",
66
"scripts": {
@@ -44,7 +44,7 @@
4444
},
4545
"dependencies": {
4646
"require-all": "^2.2.0",
47-
"vue-eslint-parser": "^2.0.1-beta.1"
47+
"vue-eslint-parser": "^2.0.1"
4848
},
4949
"devDependencies": {
5050
"@types/node": "^4.2.16",

Diff for: tests/lib/rules/no-side-effects-in-computed-properties.js

+14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ ruleTester.run('no-side-effects-in-computed-properties', rule, {
7373
test: 'example'
7474
}
7575
}
76+
},
77+
test9() {
78+
return Object.keys(this.a).sort()
79+
},
80+
test10: {
81+
get() {
82+
return Object.keys(this.a).sort()
83+
}
7684
}
7785
}
7886
})`,
@@ -144,6 +152,9 @@ ruleTester.run('no-side-effects-in-computed-properties', rule, {
144152
this.something[index] = thing[index]
145153
return this.something
146154
},
155+
test6() {
156+
return this.something.keys.sort()
157+
}
147158
}
148159
})`,
149160
parserOptions,
@@ -165,6 +176,9 @@ ruleTester.run('no-side-effects-in-computed-properties', rule, {
165176
}, {
166177
line: 21,
167178
message: 'Unexpected side effect in "test5" computed property.'
179+
}, {
180+
line: 25,
181+
message: 'Unexpected side effect in "test6" computed property.'
168182
}]
169183
},
170184
{

0 commit comments

Comments
 (0)