Skip to content

Commit 8718deb

Browse files
committed
Remove redundant code & merge with master
1 parent 689e0ea commit 8718deb

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

lib/rules/no-async-in-computed-properties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function create (context) {
114114
})
115115
}
116116
},
117-
utils.executeOnVueComponent(context, (obj) => {
117+
utils.executeOnVue(context, (obj) => {
118118
const computedProperties = utils.getComputedProperties(obj)
119119

120120
computedProperties.forEach(cp => {

lib/rules/no-shared-component-data.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,22 @@ function create (context) {
1111
// Public
1212
// ----------------------------------------------------------------------
1313

14-
return Object.assign({},
15-
utils.executeOnVueComponent(context, (obj) => {
16-
obj.properties
17-
.filter(p =>
18-
p.type === 'Property' &&
19-
p.key.type === 'Identifier' &&
20-
p.key.name === 'data' &&
21-
p.value.type !== 'FunctionExpression' &&
22-
p.value.type !== 'Identifier'
23-
)
24-
.forEach(cp => {
25-
context.report({
26-
node: cp.value,
27-
message: '`data` property in component must be a function'
28-
})
14+
return utils.executeOnVueComponent(context, (obj) => {
15+
obj.properties
16+
.filter(p =>
17+
p.type === 'Property' &&
18+
p.key.type === 'Identifier' &&
19+
p.key.name === 'data' &&
20+
p.value.type !== 'FunctionExpression' &&
21+
p.value.type !== 'Identifier'
22+
)
23+
.forEach(cp => {
24+
context.report({
25+
node: cp.value,
26+
message: '`data` property in component must be a function'
2927
})
30-
})
31-
)
28+
})
29+
})
3230
}
3331

3432
// ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)