From 6d315ce9e239ada6ec755e3a9dbdaedc4e736472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 19 Oct 2022 17:08:13 +0200 Subject: [PATCH] :fire: Remove wrong linting from Code node --- .../src/components/CodeNodeEditor/linter.ts | 28 ------------------- .../src/plugins/i18n/locales/en.json | 1 - 2 files changed, 29 deletions(-) diff --git a/packages/editor-ui/src/components/CodeNodeEditor/linter.ts b/packages/editor-ui/src/components/CodeNodeEditor/linter.ts index f3958611ed9a5..2edf25425fb19 100644 --- a/packages/editor-ui/src/components/CodeNodeEditor/linter.ts +++ b/packages/editor-ui/src/components/CodeNodeEditor/linter.ts @@ -263,34 +263,6 @@ export const linterExtension = (Vue as CodeNodeEditorMixin).extend({ }); } - /** - * Lint for `.all()` called with argument in `runOnceForAllItems` mode - * - * $input.itemMatching() - */ - - if (this.mode === 'runOnceForAllItems') { - type TargetNode = RangeNode & { callee: RangeNode & { property: RangeNode } }; - - const isItemMatchingCallWithoutArg = (node: Node) => - node.type === 'CallExpression' && - node.callee.type === 'MemberExpression' && - node.callee.property.type === 'Identifier' && - node.callee.property.name === 'all' && - node.arguments.length !== 0; - - walk(ast, isItemMatchingCallWithoutArg).forEach((node) => { - const [start, end] = this.getRange(node.callee.property); - - lintings.push({ - from: start, - to: end + '()'.length, - severity: DEFAULT_LINTER_SEVERITY, - message: this.$locale.baseText('codeNodeEditor.linter.allItems.allCalledWithArg'), - }); - }); - } - /** * Lint for `.first()` or `.last()` called with argument in `runOnceForAllItems` mode * diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index eb51f1bbfba76..9d9a3a6db2a4d 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -219,7 +219,6 @@ "codeNodeEditor.completer.selector.last": "@:_reusableBaseText.codeNodeEditor.completer.last", "codeNodeEditor.completer.selector.params": "The parameters of the node", "codeNodeEditor.linter.allItems.firstOrLastCalledWithArg": "expects no argument.", - "codeNodeEditor.linter.allItems.allCalledWithArg": "`.all()` expects no argument. To access a specific item, use bracket notation: `.all()[index]`.", "codeNodeEditor.linter.allItems.emptyReturn": "Code doesn't return items properly. Please return an array of objects, one for each item you would like to output.", "codeNodeEditor.linter.allItems.itemCall": "`item` is a property to access, not a method to call. Did you mean `.item` without brackets?", "codeNodeEditor.linter.allItems.itemMatchingNoArg": "`.itemMatching()` expects an item index to be passed in as its argument.",