From 60b240bf69721019cb81ce827bfc96b86fe4e0b8 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Sun, 27 Oct 2019 21:29:45 +0800 Subject: [PATCH] fix lint --- src/compiler/compile/Component.ts | 6 +++--- src/compiler/compile/utils/is_used_as_reference.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index cc3bf2e308..4d8abadf34 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -680,7 +680,7 @@ export default class Component { const { body } = script.content; let i = body.length; - while(--i >= 0) { + while (--i >= 0) { const node = body[i]; if (node.type === 'ImportDeclaration') { this.extract_imports(node); @@ -721,7 +721,7 @@ export default class Component { const toRemove = []; const remove = (parent, prop, index) => { toRemove.unshift([parent, prop, index]); - } + }; walk(content, { enter(node, parent, prop, index) { @@ -757,7 +757,7 @@ export default class Component { }, }); - for(const [parent, prop, index] of toRemove) { + for (const [parent, prop, index] of toRemove) { if (parent) { if (index !== null) { parent[prop].splice(index, 1); diff --git a/src/compiler/compile/utils/is_used_as_reference.ts b/src/compiler/compile/utils/is_used_as_reference.ts index 8d55182794..3ea3d2f242 100644 --- a/src/compiler/compile/utils/is_used_as_reference.ts +++ b/src/compiler/compile/utils/is_used_as_reference.ts @@ -12,6 +12,7 @@ export default function is_used_as_reference( return true; } + /* eslint-disable no-fallthrough */ switch (parent.type) { // disregard the `foo` in `const foo = bar` case 'VariableDeclarator':