Skip to content

Commit 6bc1103

Browse files
committed
migrate to new eslint
1 parent 1b9c930 commit 6bc1103

File tree

3 files changed

+67
-47
lines changed

3 files changed

+67
-47
lines changed

.eslintrc.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import globals from "globals";
3+
import tsParser from "@typescript-eslint/parser";
4+
import n8nNodesBase from "eslint-plugin-n8n-nodes-base";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all
16+
});
17+
18+
export default defineConfig([
19+
globalIgnores(["**/.eslintrc.js", "** /*.js", "**/node_modules /**/*", "**/dist /**/*"]),
20+
{
21+
languageOptions: {
22+
globals: {
23+
...globals.browser,
24+
...globals.node,
25+
},
26+
27+
parser: tsParser,
28+
ecmaVersion: 5,
29+
sourceType: "module",
30+
31+
parserOptions: {
32+
project: ["./tsconfig.json"],
33+
extraFileExtensions: [".json"],
34+
},
35+
},
36+
},
37+
{
38+
files: ["**/package.json"],
39+
extends: compat.extends("plugin:n8n-nodes-base/community"),
40+
41+
plugins: {
42+
"n8n-nodes-base": n8nNodesBase,
43+
},
44+
45+
rules: {
46+
"n8n-nodes-base/community-package-json-name-still-default": "off",
47+
},
48+
},
49+
{
50+
files: ["./nodes/**/*.ts"],
51+
extends: compat.extends("plugin:n8n-nodes-base/nodes"),
52+
53+
plugins: {
54+
"n8n-nodes-base": n8nNodesBase,
55+
},
56+
57+
rules: {
58+
"n8n-nodes-base/node-execute-block-missing-continue-on-fail": "off",
59+
"n8n-nodes-base/node-resource-description-filename-against-convention": "off",
60+
"n8n-nodes-base/node-param-fixed-collection-type-unsorted-items": "off",
61+
"n8n-nodes-base/node-class-description-inputs-wrong-regular-node": "off",
62+
"n8n-nodes-base/node-class-description-outputs-wrong": "off",
63+
},
64+
},
65+
]);

nodes/TextManipulation/TextManipulation.node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function charsTrim(str: string, chars: string) {
117117
* @returns {string} - Returns string with unescaped escaped characters.
118118
*/
119119
function unescapeEscapedCharacters(str: string) {
120-
/*eslint-disable */
120+
121121
const escapeCharacters: Record<string, string> = {
122122
'\\0': '\0',
123123
"\\'": "'",
@@ -130,7 +130,7 @@ function unescapeEscapedCharacters(str: string) {
130130
'\\b': '\b',
131131
'\\f': '\f',
132132
};
133-
/*eslint-enable */
133+
134134

135135
return str.replace(
136136
/(\\0|\\'|\\"|\\n|\\r|\\v|\\t|\\b|\\f)|\\u([\da-fA-F]{4})|\\x([\da-fA-F]{2})|\\u{(0*(?:10|[\da-fA-F])?[\da-fA-F]{1,4})}|\\(.)/g,

0 commit comments

Comments
 (0)