@n8n/eslint-plugin-community-nodes 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$unchecked.log +4 -0
- package/README.md +9 -1
- package/dist/plugin.d.ts +48 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +16 -0
- package/dist/plugin.js.map +1 -1
- package/dist/rules/cred-filename-against-convention.d.ts +2 -0
- package/dist/rules/cred-filename-against-convention.d.ts.map +1 -0
- package/dist/rules/cred-filename-against-convention.js +42 -0
- package/dist/rules/cred-filename-against-convention.js.map +1 -0
- package/dist/rules/icon-prefer-themed-variants.d.ts +2 -0
- package/dist/rules/icon-prefer-themed-variants.d.ts.map +1 -0
- package/dist/rules/icon-prefer-themed-variants.js +53 -0
- package/dist/rules/icon-prefer-themed-variants.js.map +1 -0
- package/dist/rules/icon-validation.d.ts +1 -1
- package/dist/rules/icon-validation.d.ts.map +1 -1
- package/dist/rules/icon-validation.js +4 -25
- package/dist/rules/icon-validation.js.map +1 -1
- package/dist/rules/index.d.ts +9 -1
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +16 -0
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/no-dangerous-functions.d.ts +2 -0
- package/dist/rules/no-dangerous-functions.d.ts.map +1 -0
- package/dist/rules/no-dangerous-functions.js +121 -0
- package/dist/rules/no-dangerous-functions.js.map +1 -0
- package/dist/rules/no-emoji-in-options.d.ts +2 -0
- package/dist/rules/no-emoji-in-options.d.ts.map +1 -0
- package/dist/rules/no-emoji-in-options.js +86 -0
- package/dist/rules/no-emoji-in-options.js.map +1 -0
- package/dist/rules/node-filename-against-convention.d.ts +2 -0
- package/dist/rules/node-filename-against-convention.d.ts.map +1 -0
- package/dist/rules/node-filename-against-convention.js +61 -0
- package/dist/rules/node-filename-against-convention.js.map +1 -0
- package/dist/rules/node-registration-complete.d.ts +2 -0
- package/dist/rules/node-registration-complete.d.ts.map +1 -0
- package/dist/rules/node-registration-complete.js +60 -0
- package/dist/rules/node-registration-complete.js.map +1 -0
- package/dist/rules/require-version.d.ts +2 -0
- package/dist/rules/require-version.d.ts.map +1 -0
- package/dist/rules/require-version.js +50 -0
- package/dist/rules/require-version.js.map +1 -0
- package/dist/rules/valid-author.d.ts +2 -0
- package/dist/rules/valid-author.d.ts.map +1 -0
- package/dist/rules/valid-author.js +89 -0
- package/dist/rules/valid-author.js.map +1 -0
- package/dist/typecheck.tsbuildinfo +1 -0
- package/dist/utils/file-utils.d.ts +7 -2
- package/dist/utils/file-utils.d.ts.map +1 -1
- package/dist/utils/file-utils.js +47 -10
- package/dist/utils/file-utils.js.map +1 -1
- package/docs/rules/cred-filename-against-convention.md +42 -0
- package/docs/rules/icon-prefer-themed-variants.md +71 -0
- package/docs/rules/icon-validation.md +5 -3
- package/docs/rules/no-dangerous-functions.md +41 -0
- package/docs/rules/no-emoji-in-options.md +60 -0
- package/docs/rules/node-filename-against-convention.md +50 -0
- package/docs/rules/node-registration-complete.md +46 -0
- package/docs/rules/require-version.md +51 -0
- package/docs/rules/valid-author.md +60 -0
- package/package.json +5 -4
- package/src/plugin.ts +16 -0
- package/src/rules/cred-filename-against-convention.test.ts +72 -0
- package/src/rules/cred-filename-against-convention.ts +48 -0
- package/src/rules/icon-prefer-themed-variants.test.ts +128 -0
- package/src/rules/icon-prefer-themed-variants.ts +70 -0
- package/src/rules/icon-validation.test.ts +10 -0
- package/src/rules/icon-validation.ts +4 -28
- package/src/rules/index.ts +16 -0
- package/src/rules/no-dangerous-functions.test.ts +83 -0
- package/src/rules/no-dangerous-functions.ts +155 -0
- package/src/rules/no-emoji-in-options.test.ts +157 -0
- package/src/rules/no-emoji-in-options.ts +105 -0
- package/src/rules/node-filename-against-convention.test.ts +115 -0
- package/src/rules/node-filename-against-convention.ts +76 -0
- package/src/rules/node-registration-complete.test.ts +87 -0
- package/src/rules/node-registration-complete.ts +79 -0
- package/src/rules/require-version.test.ts +90 -0
- package/src/rules/require-version.ts +62 -0
- package/src/rules/valid-author.test.ts +108 -0
- package/src/rules/valid-author.ts +100 -0
- package/src/utils/file-utils.ts +58 -11
- package/.turbo/turbo-build.log +0 -4
- package/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-validation.js","sourceRoot":"","sources":["../../src/rules/icon-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACN,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"icon-validation.js","sourceRoot":"","sources":["../../src/rules/icon-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACN,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,UAAU,GACV,MAAM,mBAAmB,CAAC;AAE3B,MAAM,QAAQ,GAAG;IAChB,gBAAgB,EAAE,2CAA2C;IAC7D,aAAa,EAAE,8EAA8E;IAC7F,eAAe,EAAE,oEAAoE;IACrF,WAAW,EAAE,0DAA0D;IACvE,cAAc,EAAE,oCAAoC;IACpD,eAAe,EAAE,mCAAmC;IACpD,WAAW,EAAE,yCAAyC;CAC7C,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC5C,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACL,WAAW,EACV,gHAAgH;SACjH;QACD,QAAQ;QACR,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AK;gCACR,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gCACjC,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gCACrD,IAAI,YAAY,EAAE,CAAC;oCAClB,OAAO,KAAK,CAAC,eAAe,CAAC,YAAY,EAAE,iCAAiC,CAAC,CAAC;gCAC/E,CAAC;gCACD,OAAO,IAAI,CAAC;4BACb,CAAC;yBACD,CAAC,CAAC;wBAEH,OAAO,CAAC,MAAM,CAAC;4BACd,IAAI;4BACJ,SAAS,EAAE,aAAa;4BACxB,OAAO,EAAE,WAAW;yBACpB,CAAC,CAAC;wBACH,OAAO;oBACR,CAAC;oBAED,iBAAiB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC;YACF,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
|
package/dist/rules/index.d.ts
CHANGED
|
@@ -4,17 +4,20 @@ export declare const rules: {
|
|
|
4
4
|
'no-restricted-imports': import("@typescript-eslint/utils/ts-eslint").RuleModule<"restrictedImport" | "restrictedRequire" | "restrictedDynamicImport", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
5
5
|
'credential-password-field': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingPasswordOption", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
6
6
|
'no-deprecated-workflow-functions': import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedRequestFunction" | "deprecatedFunction" | "deprecatedType" | "deprecatedWithoutReplacement" | "suggestReplaceFunction" | "suggestReplaceType", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
7
|
+
'no-emoji-in-options': import("@typescript-eslint/utils/ts-eslint").RuleModule<"emojiInOption", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
7
8
|
'node-usable-as-tool': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingUsableAsTool", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
8
9
|
'options-sorted-alphabetically': import("@typescript-eslint/utils/ts-eslint").RuleModule<"optionsNotSorted", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
10
|
'package-name-convention': import("@typescript-eslint/utils/ts-eslint").RuleModule<"renameTo" | "invalidPackageName" | "missingName" | "defaultPlaceholderName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
10
11
|
'credential-test-required': import("@typescript-eslint/utils/ts-eslint").RuleModule<"addTemplate" | "missingCredentialTest", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
12
|
'no-credential-reuse': import("@typescript-eslint/utils/ts-eslint").RuleModule<"didYouMean" | "useAvailable" | "credentialNotInPackage", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
|
+
'no-dangerous-functions': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noEval" | "noFunctionConstructor" | "noChildProcess", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
12
14
|
'no-forbidden-lifecycle-scripts': import("@typescript-eslint/utils/ts-eslint").RuleModule<"forbiddenScript", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
13
15
|
'no-http-request-with-manual-auth': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useHttpRequestWithAuthentication", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
14
16
|
'no-overrides-field': import("@typescript-eslint/utils/ts-eslint").RuleModule<"overridesForbidden", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
15
17
|
'no-runtime-dependencies': import("@typescript-eslint/utils/ts-eslint").RuleModule<"runtimeDependenciesForbidden", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
16
18
|
'no-template-placeholders': import("@typescript-eslint/utils/ts-eslint").RuleModule<"unresolvedPlaceholder", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
17
|
-
'icon-validation': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingIcon" | "addPlaceholder" | "iconFileNotFound" | "
|
|
19
|
+
'icon-validation': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingIcon" | "addPlaceholder" | "iconFileNotFound" | "lightDarkSame" | "invalidIconPath" | "addFileProtocol" | "similarIcon", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
20
|
+
'icon-prefer-themed-variants': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingThemedVariants", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
18
21
|
'resource-operation-pattern': import("@typescript-eslint/utils/ts-eslint").RuleModule<"tooManyOperationsWithoutResources", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
19
22
|
'credential-documentation-url': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidDocumentationUrl", [{
|
|
20
23
|
allowUrls?: boolean;
|
|
@@ -25,8 +28,11 @@ export declare const rules: {
|
|
|
25
28
|
'cred-class-name-field-conventions': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingSuffix" | "uppercaseFirstChar", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
26
29
|
'cred-class-name-suffix': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingSuffix", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
27
30
|
'cred-class-oauth2-naming': import("@typescript-eslint/utils/ts-eslint").RuleModule<"classNameMissingOAuth2" | "nameMissingOAuth2" | "displayNameMissingOAuth2", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
31
|
+
'cred-filename-against-convention': import("@typescript-eslint/utils/ts-eslint").RuleModule<"renameFile", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
28
32
|
'node-connection-type-literal': import("@typescript-eslint/utils/ts-eslint").RuleModule<"stringLiteralInInputs" | "stringLiteralInOutputs" | "unknownStringLiteralInInputs" | "unknownStringLiteralInOutputs", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
33
|
+
'node-filename-against-convention': import("@typescript-eslint/utils/ts-eslint").RuleModule<"renameFile", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
29
34
|
'node-operation-error-itemindex': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingItemIndex", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
35
|
+
'node-registration-complete': import("@typescript-eslint/utils/ts-eslint").RuleModule<"nodeNotRegistered", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
30
36
|
'missing-paired-item': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingPairedItem", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
31
37
|
'no-builder-hint-leakage': import("@typescript-eslint/utils/ts-eslint").RuleModule<"wireExpression" | "connectionTypeLiteral", [{
|
|
32
38
|
scope?: "builderHint" | "all";
|
|
@@ -36,6 +42,8 @@ export declare const rules: {
|
|
|
36
42
|
'require-continue-on-fail': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingContinueOnFail", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
37
43
|
'require-node-api-error': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useNodeApiError" | "useNodeApiErrorInsteadOfGeneric", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
38
44
|
'require-node-description-fields': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingField" | "missingFields", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
45
|
+
'require-version': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingVersion" | "invalidVersion", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
46
|
+
'valid-author': import("@typescript-eslint/utils/ts-eslint").RuleModule<"authorMissing" | "authorNameMissing" | "authorEmailMissing", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
39
47
|
'valid-credential-references': import("@typescript-eslint/utils/ts-eslint").RuleModule<"didYouMean" | "credentialNotFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
40
48
|
'valid-description': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingDescription" | "emptyDescription", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
41
49
|
'valid-peer-dependencies': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingPeerDependencies" | "invalidPeerDependenciesType" | "missingN8nWorkflow" | "pinnedN8nWorkflow" | "forbiddenPeerDependency", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AA+CA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CuB,CAAC"}
|
package/dist/rules/index.js
CHANGED
|
@@ -3,15 +3,19 @@ import { CredClassFieldIconMissingRule } from './cred-class-field-icon-missing.j
|
|
|
3
3
|
import { CredClassNameFieldConventionsRule } from './cred-class-name-field-conventions.js';
|
|
4
4
|
import { CredClassNameSuffixRule } from './cred-class-name-suffix.js';
|
|
5
5
|
import { CredClassOAuth2NamingRule } from './cred-class-oauth2-naming.js';
|
|
6
|
+
import { CredFilenameAgainstConventionRule } from './cred-filename-against-convention.js';
|
|
6
7
|
import { CredentialDocumentationUrlRule } from './credential-documentation-url.js';
|
|
7
8
|
import { CredentialPasswordFieldRule } from './credential-password-field.js';
|
|
8
9
|
import { CredentialTestRequiredRule } from './credential-test-required.js';
|
|
10
|
+
import { IconPreferThemedVariantsRule } from './icon-prefer-themed-variants.js';
|
|
9
11
|
import { IconValidationRule } from './icon-validation.js';
|
|
10
12
|
import { MissingPairedItemRule } from './missing-paired-item.js';
|
|
11
13
|
import { N8nObjectValidationRule } from './n8n-object-validation.js';
|
|
12
14
|
import { NoBuilderHintLeakageRule } from './no-builder-hint-leakage.js';
|
|
13
15
|
import { NoCredentialReuseRule } from './no-credential-reuse.js';
|
|
16
|
+
import { NoDangerousFunctionsRule } from './no-dangerous-functions.js';
|
|
14
17
|
import { NoDeprecatedWorkflowFunctionsRule } from './no-deprecated-workflow-functions.js';
|
|
18
|
+
import { NoEmojiInOptionsRule } from './no-emoji-in-options.js';
|
|
15
19
|
import { NoForbiddenLifecycleScriptsRule } from './no-forbidden-lifecycle-scripts.js';
|
|
16
20
|
import { NoHttpRequestWithManualAuthRule } from './no-http-request-with-manual-auth.js';
|
|
17
21
|
import { NoOverridesFieldRule } from './no-overrides-field.js';
|
|
@@ -21,7 +25,9 @@ import { NoRuntimeDependenciesRule } from './no-runtime-dependencies.js';
|
|
|
21
25
|
import { NoTemplatePlaceholdersRule } from './no-template-placeholders.js';
|
|
22
26
|
import { NodeClassDescriptionIconMissingRule } from './node-class-description-icon-missing.js';
|
|
23
27
|
import { NodeConnectionTypeLiteralRule } from './node-connection-type-literal.js';
|
|
28
|
+
import { NodeFilenameAgainstConventionRule } from './node-filename-against-convention.js';
|
|
24
29
|
import { NodeOperationErrorItemIndexRule } from './node-operation-error-itemindex.js';
|
|
30
|
+
import { NodeRegistrationCompleteRule } from './node-registration-complete.js';
|
|
25
31
|
import { NodeUsableAsToolRule } from './node-usable-as-tool.js';
|
|
26
32
|
import { OptionsSortedAlphabeticallyRule } from './options-sorted-alphabetically.js';
|
|
27
33
|
import { PackageNameConventionRule } from './package-name-convention.js';
|
|
@@ -29,7 +35,9 @@ import { RequireCommunityNodeKeywordRule } from './require-community-node-keywor
|
|
|
29
35
|
import { RequireContinueOnFailRule } from './require-continue-on-fail.js';
|
|
30
36
|
import { RequireNodeApiErrorRule } from './require-node-api-error.js';
|
|
31
37
|
import { RequireNodeDescriptionFieldsRule } from './require-node-description-fields.js';
|
|
38
|
+
import { RequireVersionRule } from './require-version.js';
|
|
32
39
|
import { ResourceOperationPatternRule } from './resource-operation-pattern.js';
|
|
40
|
+
import { ValidAuthorRule } from './valid-author.js';
|
|
33
41
|
import { ValidCredentialReferencesRule } from './valid-credential-references.js';
|
|
34
42
|
import { ValidDescriptionRule } from './valid-description.js';
|
|
35
43
|
import { ValidPeerDependenciesRule } from './valid-peer-dependencies.js';
|
|
@@ -40,17 +48,20 @@ export const rules = {
|
|
|
40
48
|
'no-restricted-imports': NoRestrictedImportsRule,
|
|
41
49
|
'credential-password-field': CredentialPasswordFieldRule,
|
|
42
50
|
'no-deprecated-workflow-functions': NoDeprecatedWorkflowFunctionsRule,
|
|
51
|
+
'no-emoji-in-options': NoEmojiInOptionsRule,
|
|
43
52
|
'node-usable-as-tool': NodeUsableAsToolRule,
|
|
44
53
|
'options-sorted-alphabetically': OptionsSortedAlphabeticallyRule,
|
|
45
54
|
'package-name-convention': PackageNameConventionRule,
|
|
46
55
|
'credential-test-required': CredentialTestRequiredRule,
|
|
47
56
|
'no-credential-reuse': NoCredentialReuseRule,
|
|
57
|
+
'no-dangerous-functions': NoDangerousFunctionsRule,
|
|
48
58
|
'no-forbidden-lifecycle-scripts': NoForbiddenLifecycleScriptsRule,
|
|
49
59
|
'no-http-request-with-manual-auth': NoHttpRequestWithManualAuthRule,
|
|
50
60
|
'no-overrides-field': NoOverridesFieldRule,
|
|
51
61
|
'no-runtime-dependencies': NoRuntimeDependenciesRule,
|
|
52
62
|
'no-template-placeholders': NoTemplatePlaceholdersRule,
|
|
53
63
|
'icon-validation': IconValidationRule,
|
|
64
|
+
'icon-prefer-themed-variants': IconPreferThemedVariantsRule,
|
|
54
65
|
'resource-operation-pattern': ResourceOperationPatternRule,
|
|
55
66
|
'credential-documentation-url': CredentialDocumentationUrlRule,
|
|
56
67
|
'node-class-description-icon-missing': NodeClassDescriptionIconMissingRule,
|
|
@@ -58,8 +69,11 @@ export const rules = {
|
|
|
58
69
|
'cred-class-name-field-conventions': CredClassNameFieldConventionsRule,
|
|
59
70
|
'cred-class-name-suffix': CredClassNameSuffixRule,
|
|
60
71
|
'cred-class-oauth2-naming': CredClassOAuth2NamingRule,
|
|
72
|
+
'cred-filename-against-convention': CredFilenameAgainstConventionRule,
|
|
61
73
|
'node-connection-type-literal': NodeConnectionTypeLiteralRule,
|
|
74
|
+
'node-filename-against-convention': NodeFilenameAgainstConventionRule,
|
|
62
75
|
'node-operation-error-itemindex': NodeOperationErrorItemIndexRule,
|
|
76
|
+
'node-registration-complete': NodeRegistrationCompleteRule,
|
|
63
77
|
'missing-paired-item': MissingPairedItemRule,
|
|
64
78
|
'no-builder-hint-leakage': NoBuilderHintLeakageRule,
|
|
65
79
|
'n8n-object-validation': N8nObjectValidationRule,
|
|
@@ -67,6 +81,8 @@ export const rules = {
|
|
|
67
81
|
'require-continue-on-fail': RequireContinueOnFailRule,
|
|
68
82
|
'require-node-api-error': RequireNodeApiErrorRule,
|
|
69
83
|
'require-node-description-fields': RequireNodeDescriptionFieldsRule,
|
|
84
|
+
'require-version': RequireVersionRule,
|
|
85
|
+
'valid-author': ValidAuthorRule,
|
|
70
86
|
'valid-credential-references': ValidCredentialReferencesRule,
|
|
71
87
|
'valid-description': ValidDescriptionRule,
|
|
72
88
|
'valid-peer-dependencies': ValidPeerDependenciesRule,
|
package/dist/rules/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,uBAAuB,E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AAE,+BAA+B;IACjE,4BAA4B,EAAE,4BAA4B;IAC1D,qBAAqB,EAAE,qBAAqB;IAC5C,yBAAyB,EAAE,wBAAwB;IACnD,uBAAuB,EAAE,uBAAuB;IAChD,gCAAgC,EAAE,+BAA+B;IACjE,0BAA0B,EAAE,yBAAyB;IACrD,wBAAwB,EAAE,uBAAuB;IACjD,iCAAiC,EAAE,gCAAgC;IACnE,iBAAiB,EAAE,kBAAkB;IACrC,cAAc,EAAE,eAAe;IAC/B,6BAA6B,EAAE,6BAA6B;IAC5D,mBAAmB,EAAE,oBAAoB;IACzC,yBAAyB,EAAE,yBAAyB;IACpD,4BAA4B,EAAE,4BAA4B;CAClB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const NoDangerousFunctionsRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noEval" | "noFunctionConstructor" | "noChildProcess", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
|
+
//# sourceMappingURL=no-dangerous-functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-dangerous-functions.d.ts","sourceRoot":"","sources":["../../src/rules/no-dangerous-functions.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,wBAAwB,wLA0HnC,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
import { createRule, getModulePath, isDirectRequireCall, isRequireMemberCall, } from '../utils/index.js';
|
|
3
|
+
const { AST_NODE_TYPES } = TSESTree;
|
|
4
|
+
const CHILD_PROCESS_MODULES = new Set(['child_process', 'node:child_process']);
|
|
5
|
+
/**
|
|
6
|
+
* `child_process` functions that spawn OS processes and are therefore
|
|
7
|
+
* vulnerable to command injection when fed untrusted input.
|
|
8
|
+
*/
|
|
9
|
+
const DANGEROUS_CHILD_PROCESS_FUNCTIONS = new Set([
|
|
10
|
+
'exec',
|
|
11
|
+
'execSync',
|
|
12
|
+
'execFile',
|
|
13
|
+
'execFileSync',
|
|
14
|
+
'spawn',
|
|
15
|
+
'spawnSync',
|
|
16
|
+
'fork',
|
|
17
|
+
]);
|
|
18
|
+
const isChildProcessModule = (node) => {
|
|
19
|
+
const modulePath = getModulePath(node);
|
|
20
|
+
return modulePath !== null && CHILD_PROCESS_MODULES.has(modulePath);
|
|
21
|
+
};
|
|
22
|
+
export const NoDangerousFunctionsRule = createRule({
|
|
23
|
+
name: 'no-dangerous-functions',
|
|
24
|
+
meta: {
|
|
25
|
+
type: 'problem',
|
|
26
|
+
docs: {
|
|
27
|
+
description: 'Disallow `eval`, the `Function` constructor, and `child_process` process-spawning functions (`exec`, `spawn`, etc.) in community nodes.',
|
|
28
|
+
},
|
|
29
|
+
messages: {
|
|
30
|
+
noEval: 'Use of `eval` is not allowed. It executes arbitrary code and is a common source of remote code execution vulnerabilities.',
|
|
31
|
+
noFunctionConstructor: 'Use of the `Function` constructor is not allowed. Like `eval`, it executes arbitrary code from strings.',
|
|
32
|
+
noChildProcess: 'Use of `{{ name }}` from `child_process` is not allowed. Spawning OS processes is not permitted in community nodes and can lead to command injection.',
|
|
33
|
+
},
|
|
34
|
+
schema: [],
|
|
35
|
+
},
|
|
36
|
+
defaultOptions: [],
|
|
37
|
+
create(context) {
|
|
38
|
+
// Local names bound to dangerous named imports, e.g. `import { exec as run }` -> `run`.
|
|
39
|
+
const dangerousLocalNames = new Map();
|
|
40
|
+
// Local names bound to the whole module, e.g. `import * as cp` or `const cp = require(...)`.
|
|
41
|
+
const namespaceNames = new Set();
|
|
42
|
+
const recordDestructuredModule = (pattern) => {
|
|
43
|
+
for (const property of pattern.properties) {
|
|
44
|
+
if (property.type !== AST_NODE_TYPES.Property ||
|
|
45
|
+
property.key.type !== AST_NODE_TYPES.Identifier ||
|
|
46
|
+
!DANGEROUS_CHILD_PROCESS_FUNCTIONS.has(property.key.name)) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (property.value.type === AST_NODE_TYPES.Identifier) {
|
|
50
|
+
dangerousLocalNames.set(property.value.name, property.key.name);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
ImportDeclaration(node) {
|
|
56
|
+
if (!CHILD_PROCESS_MODULES.has(node.source.value))
|
|
57
|
+
return;
|
|
58
|
+
for (const specifier of node.specifiers) {
|
|
59
|
+
if (specifier.type === AST_NODE_TYPES.ImportSpecifier &&
|
|
60
|
+
specifier.imported.type === AST_NODE_TYPES.Identifier &&
|
|
61
|
+
DANGEROUS_CHILD_PROCESS_FUNCTIONS.has(specifier.imported.name)) {
|
|
62
|
+
dangerousLocalNames.set(specifier.local.name, specifier.imported.name);
|
|
63
|
+
}
|
|
64
|
+
else if (specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier ||
|
|
65
|
+
specifier.type === AST_NODE_TYPES.ImportDefaultSpecifier) {
|
|
66
|
+
namespaceNames.add(specifier.local.name);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
VariableDeclarator(node) {
|
|
71
|
+
if (node.init?.type !== AST_NODE_TYPES.CallExpression ||
|
|
72
|
+
!(isDirectRequireCall(node.init) || isRequireMemberCall(node.init)) ||
|
|
73
|
+
!isChildProcessModule(node.init.arguments[0] ?? null)) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (node.id.type === AST_NODE_TYPES.ObjectPattern) {
|
|
77
|
+
recordDestructuredModule(node.id);
|
|
78
|
+
}
|
|
79
|
+
else if (node.id.type === AST_NODE_TYPES.Identifier) {
|
|
80
|
+
namespaceNames.add(node.id.name);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
NewExpression(node) {
|
|
84
|
+
if (node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === 'Function') {
|
|
85
|
+
context.report({ node, messageId: 'noFunctionConstructor' });
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
CallExpression(node) {
|
|
89
|
+
const { callee } = node;
|
|
90
|
+
if (callee.type === AST_NODE_TYPES.Identifier) {
|
|
91
|
+
if (callee.name === 'eval') {
|
|
92
|
+
context.report({ node, messageId: 'noEval' });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (callee.name === 'Function') {
|
|
96
|
+
context.report({ node, messageId: 'noFunctionConstructor' });
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const originalName = dangerousLocalNames.get(callee.name);
|
|
100
|
+
if (originalName) {
|
|
101
|
+
context.report({ node, messageId: 'noChildProcess', data: { name: originalName } });
|
|
102
|
+
}
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (callee.type === AST_NODE_TYPES.MemberExpression &&
|
|
106
|
+
!callee.computed &&
|
|
107
|
+
callee.object.type === AST_NODE_TYPES.Identifier &&
|
|
108
|
+
namespaceNames.has(callee.object.name) &&
|
|
109
|
+
callee.property.type === AST_NODE_TYPES.Identifier &&
|
|
110
|
+
DANGEROUS_CHILD_PROCESS_FUNCTIONS.has(callee.property.name)) {
|
|
111
|
+
context.report({
|
|
112
|
+
node,
|
|
113
|
+
messageId: 'noChildProcess',
|
|
114
|
+
data: { name: callee.property.name },
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
//# sourceMappingURL=no-dangerous-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-dangerous-functions.js","sourceRoot":"","sources":["../../src/rules/no-dangerous-functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EACN,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,EAAE,cAAc,EAAE,GAAG,QAAQ,CAAC;AAEpC,MAAM,qBAAqB,GAAG,IAAI,GA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;oBAC1D,IAAI,YAAY,EAAE,CAAC;wBAClB,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;oBACrF,CAAC;oBAED,OAAO;gBACR,CAAC;gBAED,IACC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB;oBAC/C,CAAC,MAAM,CAAC,QAAQ;oBAChB,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU;oBAChD,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;oBACtC,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU;oBAClD,iCAAiC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC1D,CAAC;oBACF,OAAO,CAAC,MAAM,CAAC;wBACd,IAAI;wBACJ,SAAS,EAAE,gBAAgB;wBAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;qBACpC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-emoji-in-options.d.ts","sourceRoot":"","sources":["../../src/rules/no-emoji-in-options.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,oBAAoB,kJAoF/B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { isNodeTypeClass, findClassProperty, getStringLiteralValue, isFileType, createRule, } from '../utils/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Matches emoji characters: pictographs (😀, 🚀, ✉️, etc.) and regional
|
|
5
|
+
* indicator symbols that compose flag emoji (🇺🇸).
|
|
6
|
+
*/
|
|
7
|
+
const EMOJI_REGEX = /(\p{Extended_Pictographic}|\p{Regional_Indicator})/gu;
|
|
8
|
+
/** Keys whose string values are surfaced to users as labels. */
|
|
9
|
+
const LABEL_KEYS = new Set(['name', 'displayName']);
|
|
10
|
+
export const NoEmojiInOptionsRule = createRule({
|
|
11
|
+
name: 'no-emoji-in-options',
|
|
12
|
+
meta: {
|
|
13
|
+
type: 'problem',
|
|
14
|
+
docs: {
|
|
15
|
+
description: 'Disallow emoji characters in node option name and displayName values',
|
|
16
|
+
},
|
|
17
|
+
messages: {
|
|
18
|
+
emojiInOption: 'Emoji characters are not allowed in "{{ key }}" values. Found: {{ emoji }}.',
|
|
19
|
+
},
|
|
20
|
+
schema: [],
|
|
21
|
+
},
|
|
22
|
+
defaultOptions: [],
|
|
23
|
+
create(context) {
|
|
24
|
+
if (!isFileType(context.filename, '.node.ts')) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
const checkLabelValue = (key, valueNode) => {
|
|
28
|
+
const value = getStringLiteralValue(valueNode);
|
|
29
|
+
if (value === null) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const matches = value.match(EMOJI_REGEX);
|
|
33
|
+
if (!matches) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
context.report({
|
|
37
|
+
node: valueNode,
|
|
38
|
+
messageId: 'emojiInOption',
|
|
39
|
+
data: {
|
|
40
|
+
key,
|
|
41
|
+
emoji: [...new Set(matches)].join(' '),
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const traverse = (node) => {
|
|
46
|
+
if (node.type === AST_NODE_TYPES.ObjectExpression) {
|
|
47
|
+
for (const property of node.properties) {
|
|
48
|
+
if (property.type === AST_NODE_TYPES.Property &&
|
|
49
|
+
property.key.type === AST_NODE_TYPES.Identifier &&
|
|
50
|
+
LABEL_KEYS.has(property.key.name)) {
|
|
51
|
+
checkLabelValue(property.key.name, property.value);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
for (const key in node) {
|
|
56
|
+
if (key === 'parent') {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const child = node[key];
|
|
60
|
+
if (Array.isArray(child)) {
|
|
61
|
+
for (const item of child) {
|
|
62
|
+
if (item && typeof item === 'object' && 'type' in item) {
|
|
63
|
+
traverse(item);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (child && typeof child === 'object' && 'type' in child) {
|
|
68
|
+
traverse(child);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
ClassDeclaration(node) {
|
|
74
|
+
if (!isNodeTypeClass(node)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const descriptionProperty = findClassProperty(node, 'description');
|
|
78
|
+
if (!descriptionProperty?.value) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
traverse(descriptionProperty.value);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=no-emoji-in-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-emoji-in-options.js","sourceRoot":"","sources":["../../src/rules/no-emoji-in-options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,UAAU,GACV,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,GAAG,sDAAsD,CAAC;AAE3E,gEAAgE;AAChE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;IAC9C,IAAI,EAAE,qBAAq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ources":["../../src/rules/node-filename-against-convention.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,iCAAiC,+IAsD5C,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { isNodeTypeClass, findClassProperty, findObjectProperty, getStringLiteralValue, isFileType, createRule, } from '../utils/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Converts a `description.name` to the expected node file basename by
|
|
6
|
+
* upper-casing the first character. The source of truth is `description.name`,
|
|
7
|
+
* not the class name. Example: `github` -> `Github`.
|
|
8
|
+
*/
|
|
9
|
+
function toExpectedBaseName(name) {
|
|
10
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
11
|
+
}
|
|
12
|
+
export const NodeFilenameAgainstConventionRule = createRule({
|
|
13
|
+
name: 'node-filename-against-convention',
|
|
14
|
+
meta: {
|
|
15
|
+
type: 'problem',
|
|
16
|
+
docs: {
|
|
17
|
+
description: 'Node filename must match the node `description.name`',
|
|
18
|
+
},
|
|
19
|
+
messages: {
|
|
20
|
+
renameFile: 'Node filename must match `description.name`. Rename file to "{{expected}}".',
|
|
21
|
+
},
|
|
22
|
+
schema: [],
|
|
23
|
+
},
|
|
24
|
+
defaultOptions: [],
|
|
25
|
+
create(context) {
|
|
26
|
+
if (!isFileType(context.filename, '.node.ts')) {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
ClassDeclaration(node) {
|
|
31
|
+
if (!isNodeTypeClass(node)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const descriptionProperty = findClassProperty(node, 'description');
|
|
35
|
+
if (descriptionProperty?.value?.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const nameProperty = findObjectProperty(descriptionProperty.value, 'name');
|
|
39
|
+
if (!nameProperty) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const name = getStringLiteralValue(nameProperty.value);
|
|
43
|
+
if (!name) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const expectedBaseName = toExpectedBaseName(name);
|
|
47
|
+
// Strip the `.node.ts` extension and any trailing `V<digits>` version
|
|
48
|
+
// suffix so versioned files (e.g. `GithubV2.node.ts`) are accepted.
|
|
49
|
+
const actualBaseName = path.basename(context.filename, '.node.ts').replace(/V\d+$/, '');
|
|
50
|
+
if (actualBaseName !== expectedBaseName) {
|
|
51
|
+
context.report({
|
|
52
|
+
node: nameProperty.value,
|
|
53
|
+
messageId: 'renameFile',
|
|
54
|
+
data: { expected: `${expectedBaseName}.node.ts` },
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=node-filename-against-convention.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-filename-against-convention.js","sourceRoot":"","sources":["../../src/rules/node-filename-against-convention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,UAAU,GACV,MAAM,mBAAmB,CAAC;AAE3B;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,UAAU,CAAC;IAC3D,IAAI,EAAE,kCAAkC;IACxC,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACL,WAAW,EAAE,sDAA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,EAAE,GAAG,gBAAgB,UAAU,EAAE;qBACjD,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-registration-complete.d.ts","sourceRoot":"","sources":["../../src/rules/node-registration-complete.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,4BAA4B,sJAqDvC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { createRule, findJsonProperty, findNodeSourceFilesOnDisk, readPackageJsonNodes, } from '../utils/index.js';
|
|
4
|
+
export const NodeRegistrationCompleteRule = createRule({
|
|
5
|
+
name: 'node-registration-complete',
|
|
6
|
+
meta: {
|
|
7
|
+
type: 'problem',
|
|
8
|
+
docs: {
|
|
9
|
+
description: 'Ensure every `.node.ts` file in the `nodes/` directory is registered in the "n8n.nodes" array of package.json',
|
|
10
|
+
},
|
|
11
|
+
messages: {
|
|
12
|
+
nodeNotRegistered: 'The node file "{{ nodeFile }}" is not registered in the "n8n.nodes" array of package.json. Add it so n8n can discover the node.',
|
|
13
|
+
},
|
|
14
|
+
schema: [],
|
|
15
|
+
},
|
|
16
|
+
defaultOptions: [],
|
|
17
|
+
create(context) {
|
|
18
|
+
if (!context.filename.endsWith('package.json')) {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
ObjectExpression(node) {
|
|
23
|
+
// Only inspect the root object of the package.json file.
|
|
24
|
+
if (node.parent?.type !== AST_NODE_TYPES.ExpressionStatement) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const nodeFilesOnDisk = findNodeSourceFilesOnDisk(context.filename);
|
|
28
|
+
if (nodeFilesOnDisk.length === 0) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const registered = new Set(readPackageJsonNodes(context.filename).map((filePath) => path.resolve(filePath)));
|
|
32
|
+
const packageDir = path.dirname(context.filename);
|
|
33
|
+
const reportTarget = resolveReportTarget(node);
|
|
34
|
+
for (const nodeFile of nodeFilesOnDisk) {
|
|
35
|
+
if (registered.has(path.resolve(nodeFile))) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
context.report({
|
|
39
|
+
node: reportTarget,
|
|
40
|
+
messageId: 'nodeNotRegistered',
|
|
41
|
+
data: { nodeFile: path.relative(packageDir, nodeFile) },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Reports against the most specific available node: the `n8n.nodes` array, the
|
|
50
|
+
* `n8n` object, or the package.json root object as a fallback.
|
|
51
|
+
*/
|
|
52
|
+
function resolveReportTarget(root) {
|
|
53
|
+
const n8nProperty = findJsonProperty(root, 'n8n');
|
|
54
|
+
if (n8nProperty?.value.type !== AST_NODE_TYPES.ObjectExpression) {
|
|
55
|
+
return n8nProperty ?? root;
|
|
56
|
+
}
|
|
57
|
+
const nodesProperty = findJsonProperty(n8nProperty.value, 'nodes');
|
|
58
|
+
return nodesProperty ?? n8nProperty;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=node-registration-complete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-registration-complete.js","sourceRoot":"","sources":["../../src/rules/node-registration-complete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC;IACtD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE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