1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-19 08:57:09 +03:00

fix(editor): Switch CodeNodeEditor linter parser to esprima-next (#4524)

* ⬆️ Switch to `esprima-next`

* 📦 Update `package-lock.json`

*  Use `esprima-next`

* 📘 Ignore type issue

* 📦 Update `package-lock.json`
This commit is contained in:
Iván Ovejero 2022-11-07 10:34:44 +01:00 committed by GitHub
parent f5c20803d7
commit 5e0ded4a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8523 additions and 15170 deletions

23680
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@
"@fortawesome/vue-fontawesome": "^2.0.2",
"axios": "^0.21.1",
"dateformat": "^3.0.3",
"esprima": "^4.0.1",
"esprima-next": "5.8.4",
"fast-json-stable-stringify": "^2.1.0",
"file-saver": "^2.0.2",
"flatted": "^3.2.4",
@ -85,7 +85,6 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/vue": "^5.8.3",
"@types/dateformat": "^3.0.0",
"@types/esprima": "^4.0.3",
"@types/express": "^4.17.6",
"@types/file-saver": "^2.0.1",
"@types/jsonpath": "^0.2.0",
@ -113,7 +112,7 @@
"vite": "2.9.5",
"vite-plugin-html": "^3.2.0",
"vite-plugin-monaco-editor": "^1.0.10",
"vue-tsc": "^0.34.15",
"vitest": "0.9.3"
"vitest": "0.9.3",
"vue-tsc": "^0.34.15"
}
}

View File

@ -1,6 +1,6 @@
import Vue from 'vue';
import { Diagnostic, linter as createLinter } from '@codemirror/lint';
import * as esprima from 'esprima';
import * as esprima from 'esprima-next';
import {
DEFAULT_LINTER_DELAY_IN_MS,

View File

@ -1,12 +1,14 @@
import * as esprima from 'esprima-next';
import type { Completion } from '@codemirror/autocomplete';
import type { Node } from 'estree';
import type { RangeNode } from './types';
export function walk<T extends RangeNode>(
node: Node,
node: Node | esprima.Program,
test: (node: Node) => boolean,
found: Node[] = [],
) {
// @ts-ignore
if (test(node)) found.push(node);
for (const key in node) {