Skip to content

Commit eeb35c0

Browse files
Upgrade linter and fix lint errors
1 parent 996858c commit eeb35c0

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

.eslintrc

+5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"parser": "babel-eslint",
3+
"extends": "standard",
34
"env": {
45
"node": true,
56
"es6": true
67
},
78
"rules": {
9+
"arrow-parens": 0,
10+
"quotes": 0,
11+
"no-multi-str": 0,
12+
"comma-dangle": [2, "only-multiline"]
813
}
914
}

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@
5252
"coveralls": "^2.11.9",
5353
"dependency-check": "^2.5.1",
5454
"doctoc": "^1.0.0",
55-
"eslint": "^2.8.0",
55+
"eslint": "^3.4.0",
56+
"eslint-config-standard": "^6.0.0",
57+
"eslint-plugin-promise": "^2.0.1",
58+
"eslint-plugin-standard": "^2.0.0",
5659
"estraverse-fb": "^1.3.1",
5760
"isparta": "^4.0.0",
5861
"rimraf": "^2.5.2",

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
if (options.errorHandler === false) return
3333

3434
const handler = (options.errorHandler === undefined)
35-
? console.error.bind(console, 'Error evaluating async computed property:')
35+
? console.error.bind(console, 'Error evaluating async computed property:')
3636
: options.errorHandler
3737

3838
handler(err.stack)

test/index.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ test("Async computed values get computed", t => {
3131
vm.$watch('b', function (val) {
3232
t.equal(val, 1337)
3333
})
34-
3534
})
3635

3736
test("Computed value being an already resolved promise updates at the next tick", t => {
@@ -86,7 +85,7 @@ test("Recalculated async value is properly recalculated", t => {
8685
b () {
8786
return new Promise(resolve => {
8887
setTimeout(() => resolve('done'), 40)
89-
})
88+
})
9089
}
9190
},
9291
data: {
@@ -125,7 +124,7 @@ test("Old async value is invalidated", t => {
125124
}
126125
})
127126
t.equal(vm.a, null)
128-
setTimeout(() => vm.waitTime = 10, 10)
127+
setTimeout(() => { vm.waitTime = 10 }, 10)
129128
vm.$watch('a', function (val) {
130129
t.equal(val, 10) // Not 40, even though we don't cancel the $watch
131130
})
@@ -167,9 +166,8 @@ test("Handle errors in computed properties", t => {
167166
})
168167
})
169168

170-
171169
test("Handle multiple asyncComputed objects the same way normal as \
172-
normal computed property objects", t => {
170+
normal computed property objects", t => {
173171
t.plan(3)
174172
const vm = new Vue({
175173
mixins: [{
@@ -184,10 +182,10 @@ test("Handle multiple asyncComputed objects the same way normal as \
184182
}],
185183
asyncComputed: {
186184
a () {
187-
return Promise.resolve('vm-a')
185+
return Promise.resolve('vm-a')
188186
},
189187
c () {
190-
return Promise.resolve('vm-c')
188+
return Promise.resolve('vm-c')
191189
}
192190
}
193191
})

0 commit comments

Comments
 (0)