diff --git a/packages/editor-ui/src/components/CodeNodeEditor/linter.ts b/packages/editor-ui/src/components/CodeNodeEditor/linter.ts index 96fe8d397..d33a5c895 100644 --- a/packages/editor-ui/src/components/CodeNodeEditor/linter.ts +++ b/packages/editor-ui/src/components/CodeNodeEditor/linter.ts @@ -133,7 +133,7 @@ export const linterExtension = (Vue as CodeNodeEditorMixin).extend({ } /** - * Lint for `.item` unavailable in `runOnceForAllItems` mode + * Lint for `.item` unavailable in `$input` in `runOnceForAllItems` mode * * $input.item -> */ @@ -141,13 +141,15 @@ export const linterExtension = (Vue as CodeNodeEditorMixin).extend({ if (this.mode === 'runOnceForAllItems') { type TargetNode = RangeNode & { property: RangeNode }; - const isUnavailableItemAccess = (node: Node) => + const isUnavailableInputItemAccess = (node: Node) => node.type === 'MemberExpression' && node.computed === false && + node.object.type === 'Identifier' && + node.object.name === '$input' && node.property.type === 'Identifier' && node.property.name === 'item'; - walk(ast, isUnavailableItemAccess).forEach((node) => { + walk(ast, isUnavailableInputItemAccess).forEach((node) => { const [start, end] = this.getRange(node.property); lintings.push({