Skip to content

Commit 251d12f

Browse files
committed
Remove redundat checks
1 parent 62dd04c commit 251d12f

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

lib/rules/require-render-return.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ function create (context) {
2525
if (!node) return
2626

2727
forbiddenNodes.forEach(el => {
28-
if (
29-
el.loc.start.line >= node.value.loc.start.line &&
30-
el.loc.end.line <= node.value.loc.end.line &&
31-
el.loc.start.line === node.value.loc.start.line
32-
) {
28+
if (node.value === el) {
3329
context.report({
3430
node: node.key,
3531
message: 'Expected to return a value in render function.'

lib/rules/return-in-computed-property.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ function create (context) {
2525

2626
computedProperties.forEach(cp => {
2727
forbiddenNodes.forEach(el => {
28-
if (
29-
cp.value &&
30-
el.loc.start.line >= cp.value.loc.start.line &&
31-
el.loc.end.line <= cp.value.loc.end.line &&
32-
el.loc.start.line === cp.value.loc.start.line
33-
) {
28+
if (cp.value && cp.value.parent === el) {
3429
context.report({
3530
node: el,
3631
message: 'Expected to return a value in "{{name}}" computed property.',

0 commit comments

Comments
 (0)