@n8n/eslint-plugin-community-nodes 0.21.0 → 0.22.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 +1 -1
- package/README.md +47 -46
- package/dist/plugin.d.ts +6 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +2 -0
- package/dist/plugin.js.map +1 -1
- package/dist/rules/ai-node-package-json.d.ts.map +1 -1
- package/dist/rules/ai-node-package-json.js +4 -3
- package/dist/rules/ai-node-package-json.js.map +1 -1
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +2 -0
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/node-class-description-name-camelcase.d.ts +2 -0
- package/dist/rules/node-class-description-name-camelcase.d.ts.map +1 -0
- package/dist/rules/node-class-description-name-camelcase.js +92 -0
- package/dist/rules/node-class-description-name-camelcase.js.map +1 -0
- package/dist/rules/valid-peer-dependencies.d.ts.map +1 -1
- package/dist/rules/valid-peer-dependencies.js +5 -3
- package/dist/rules/valid-peer-dependencies.js.map +1 -1
- package/dist/typecheck.tsbuildinfo +1 -1
- package/docs/rules/node-class-description-name-camelcase.md +41 -0
- package/docs/rules/valid-peer-dependencies.md +1 -1
- package/package.json +2 -2
- package/src/plugin.ts +2 -0
- package/src/rules/ai-node-package-json.test.ts +5 -0
- package/src/rules/ai-node-package-json.ts +4 -3
- package/src/rules/index.ts +2 -0
- package/src/rules/node-class-description-name-camelcase.test.ts +121 -0
- package/src/rules/node-class-description-name-camelcase.ts +114 -0
- package/src/rules/valid-peer-dependencies.test.ts +5 -0
- package/src/rules/valid-peer-dependencies.ts +5 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @n8n/eslint-plugin-community-nodes@0.
|
|
2
|
+
> @n8n/eslint-plugin-community-nodes@0.22.0 build:unchecked /home/runner/work/n8n/n8n/packages/@n8n/eslint-plugin-community-nodes
|
|
3
3
|
> tsc --project tsconfig.build.json --noCheck
|
|
4
4
|
|
package/README.md
CHANGED
|
@@ -44,51 +44,52 @@ export default [
|
|
|
44
44
|
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\
|
|
45
45
|
❌ Deprecated.
|
|
46
46
|
|
|
47
|
-
| Name
|
|
48
|
-
|
|
|
49
|
-
| [ai-node-package-json](docs/rules/ai-node-package-json.md)
|
|
50
|
-
| [cred-class-field-icon-missing](docs/rules/cred-class-field-icon-missing.md)
|
|
51
|
-
| [cred-class-name-field-conventions](docs/rules/cred-class-name-field-conventions.md)
|
|
52
|
-
| [cred-class-name-suffix](docs/rules/cred-class-name-suffix.md)
|
|
53
|
-
| [cred-class-oauth2-naming](docs/rules/cred-class-oauth2-naming.md)
|
|
54
|
-
| [cred-filename-against-convention](docs/rules/cred-filename-against-convention.md)
|
|
55
|
-
| [credential-documentation-url](docs/rules/credential-documentation-url.md)
|
|
56
|
-
| [credential-password-field](docs/rules/credential-password-field.md)
|
|
57
|
-
| [credential-test-required](docs/rules/credential-test-required.md)
|
|
58
|
-
| [icon-prefer-themed-variants](docs/rules/icon-prefer-themed-variants.md)
|
|
59
|
-
| [icon-validation](docs/rules/icon-validation.md)
|
|
60
|
-
| [missing-paired-item](docs/rules/missing-paired-item.md)
|
|
61
|
-
| [n8n-object-validation](docs/rules/n8n-object-validation.md)
|
|
62
|
-
| [no-builder-hint-leakage](docs/rules/no-builder-hint-leakage.md)
|
|
63
|
-
| [no-credential-reuse](docs/rules/no-credential-reuse.md)
|
|
64
|
-
| [no-dangerous-functions](docs/rules/no-dangerous-functions.md)
|
|
65
|
-
| [no-deprecated-workflow-functions](docs/rules/no-deprecated-workflow-functions.md)
|
|
66
|
-
| [no-emoji-in-options](docs/rules/no-emoji-in-options.md)
|
|
67
|
-
| [no-forbidden-lifecycle-scripts](docs/rules/no-forbidden-lifecycle-scripts.md)
|
|
68
|
-
| [no-http-request-with-manual-auth](docs/rules/no-http-request-with-manual-auth.md)
|
|
69
|
-
| [no-overrides-field](docs/rules/no-overrides-field.md)
|
|
70
|
-
| [no-restricted-globals](docs/rules/no-restricted-globals.md)
|
|
71
|
-
| [no-restricted-imports](docs/rules/no-restricted-imports.md)
|
|
72
|
-
| [no-runtime-dependencies](docs/rules/no-runtime-dependencies.md)
|
|
73
|
-
| [no-template-placeholders](docs/rules/no-template-placeholders.md)
|
|
74
|
-
| [node-class-description-icon-missing](docs/rules/node-class-description-icon-missing.md)
|
|
75
|
-
| [node-
|
|
76
|
-
| [node-
|
|
77
|
-
| [node-
|
|
78
|
-
| [node-
|
|
79
|
-
| [node-
|
|
80
|
-
| [
|
|
81
|
-
| [
|
|
82
|
-
| [
|
|
83
|
-
| [require-
|
|
84
|
-
| [require-
|
|
85
|
-
| [require-node-
|
|
86
|
-
| [require-
|
|
87
|
-
| [
|
|
88
|
-
| [
|
|
89
|
-
| [valid-
|
|
90
|
-
| [valid-
|
|
91
|
-
| [valid-
|
|
92
|
-
| [
|
|
47
|
+
| Name | Description | 💼 | ⚠️ | 🔧 | 💡 | ❌ |
|
|
48
|
+
| :------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--- | :--- | :- | :- | :- |
|
|
49
|
+
| [ai-node-package-json](docs/rules/ai-node-package-json.md) | Enforce consistency between n8n.aiNodeSdkVersion and ai-node-sdk peer dependency in community node packages | ✅ ☑️ | | | | |
|
|
50
|
+
| [cred-class-field-icon-missing](docs/rules/cred-class-field-icon-missing.md) | Credential class must have an `icon` property defined | ✅ ☑️ | | | 💡 | |
|
|
51
|
+
| [cred-class-name-field-conventions](docs/rules/cred-class-name-field-conventions.md) | Credential `name` field must end with `Api` and start with a lowercase letter | ✅ ☑️ | | 🔧 | | |
|
|
52
|
+
| [cred-class-name-suffix](docs/rules/cred-class-name-suffix.md) | Credential class names must be suffixed with `Api` | ✅ ☑️ | | 🔧 | | |
|
|
53
|
+
| [cred-class-oauth2-naming](docs/rules/cred-class-oauth2-naming.md) | OAuth2 credentials must include `OAuth2` in the class name, `name`, and `displayName` | ✅ ☑️ | | 🔧 | | |
|
|
54
|
+
| [cred-filename-against-convention](docs/rules/cred-filename-against-convention.md) | Credential filename must match the credential class name | ✅ ☑️ | | | | |
|
|
55
|
+
| [credential-documentation-url](docs/rules/credential-documentation-url.md) | Enforce valid credential documentationUrl format (URL or lowercase alphanumeric slug) | ✅ ☑️ | | 🔧 | | |
|
|
56
|
+
| [credential-password-field](docs/rules/credential-password-field.md) | Ensure credential fields with sensitive names have typeOptions.password = true | ✅ ☑️ | | 🔧 | | |
|
|
57
|
+
| [credential-test-required](docs/rules/credential-test-required.md) | Ensure credentials have a credential test | ✅ ☑️ | | | 💡 | |
|
|
58
|
+
| [icon-prefer-themed-variants](docs/rules/icon-prefer-themed-variants.md) | Encourage node and credential icons to provide light/dark variants instead of a single icon file | | ✅ ☑️ | | | |
|
|
59
|
+
| [icon-validation](docs/rules/icon-validation.md) | Validate node and credential icon files exist, use the file: protocol, and that light/dark icons are different | ✅ ☑️ | | | 💡 | |
|
|
60
|
+
| [missing-paired-item](docs/rules/missing-paired-item.md) | Require pairedItem on INodeExecutionData objects in execute() methods to preserve item linking. | ✅ ☑️ | | | | |
|
|
61
|
+
| [n8n-object-validation](docs/rules/n8n-object-validation.md) | Validate the structure of the "n8n" object in community node package.json (required keys, types, and dist/ paths) | ✅ ☑️ | | | | |
|
|
62
|
+
| [no-builder-hint-leakage](docs/rules/no-builder-hint-leakage.md) | Disallow wire-format expression syntax (={{...}}) and NodeConnectionType string literals in builderHint texts and AI-builder prompts. Use expr() and SDK-canonical references instead. | ✅ ☑️ | | | | |
|
|
63
|
+
| [no-credential-reuse](docs/rules/no-credential-reuse.md) | Prevent credential re-use security issues by ensuring nodes only reference credentials from the same package | ✅ ☑️ | | | 💡 | |
|
|
64
|
+
| [no-dangerous-functions](docs/rules/no-dangerous-functions.md) | Disallow `eval`, the `Function` constructor, and `child_process` process-spawning functions (`exec`, `spawn`, etc.) in community nodes. | ✅ ☑️ | | | | |
|
|
65
|
+
| [no-deprecated-workflow-functions](docs/rules/no-deprecated-workflow-functions.md) | Disallow usage of deprecated functions and types from n8n-workflow package | ✅ ☑️ | | | 💡 | |
|
|
66
|
+
| [no-emoji-in-options](docs/rules/no-emoji-in-options.md) | Disallow emoji characters in node option name and displayName values | ✅ ☑️ | | | | |
|
|
67
|
+
| [no-forbidden-lifecycle-scripts](docs/rules/no-forbidden-lifecycle-scripts.md) | Ban lifecycle scripts (prepare, preinstall, postinstall, etc.) in community node packages | ✅ ☑️ | | | | |
|
|
68
|
+
| [no-http-request-with-manual-auth](docs/rules/no-http-request-with-manual-auth.md) | Disallow this.helpers.httpRequest() in functions that call this.getCredentials(). Use this.helpers.httpRequestWithAuthentication() instead. | ✅ ☑️ | | | | |
|
|
69
|
+
| [no-overrides-field](docs/rules/no-overrides-field.md) | Ban the "overrides" field in community node package.json | ✅ ☑️ | | | | |
|
|
70
|
+
| [no-restricted-globals](docs/rules/no-restricted-globals.md) | Disallow usage of restricted global variables in community nodes. | ✅ | | | | |
|
|
71
|
+
| [no-restricted-imports](docs/rules/no-restricted-imports.md) | Disallow usage of restricted imports in community nodes. | ✅ | | | | |
|
|
72
|
+
| [no-runtime-dependencies](docs/rules/no-runtime-dependencies.md) | Disallow non-empty "dependencies" in community node package.json | ✅ ☑️ | | | | |
|
|
73
|
+
| [no-template-placeholders](docs/rules/no-template-placeholders.md) | Disallow unresolved template placeholders in package.json | ✅ ☑️ | | | | |
|
|
74
|
+
| [node-class-description-icon-missing](docs/rules/node-class-description-icon-missing.md) | Node class description must have an `icon` property defined. Deprecated: use `require-node-description-fields` instead. | | | | 💡 | ❌ |
|
|
75
|
+
| [node-class-description-name-camelcase](docs/rules/node-class-description-name-camelcase.md) | Node class `description.name` must be camelCase | ✅ ☑️ | | 🔧 | | |
|
|
76
|
+
| [node-connection-type-literal](docs/rules/node-connection-type-literal.md) | Disallow string literals in node description `inputs`/`outputs` — use `NodeConnectionTypes` enum instead | ✅ ☑️ | | 🔧 | | |
|
|
77
|
+
| [node-filename-against-convention](docs/rules/node-filename-against-convention.md) | Node filename must match the node `description.name` | ✅ ☑️ | | | | |
|
|
78
|
+
| [node-operation-error-itemindex](docs/rules/node-operation-error-itemindex.md) | Require { itemIndex } in NodeOperationError / NodeApiError options inside item loops | ✅ ☑️ | | | | |
|
|
79
|
+
| [node-registration-complete](docs/rules/node-registration-complete.md) | Ensure every `.node.ts` file in the `nodes/` directory is registered in the "n8n.nodes" array of package.json | | ✅ ☑️ | | | |
|
|
80
|
+
| [node-usable-as-tool](docs/rules/node-usable-as-tool.md) | Ensure node classes have usableAsTool property | ✅ ☑️ | | 🔧 | | |
|
|
81
|
+
| [options-sorted-alphabetically](docs/rules/options-sorted-alphabetically.md) | Enforce alphabetical ordering of options arrays in n8n node properties | | ✅ ☑️ | | | |
|
|
82
|
+
| [package-name-convention](docs/rules/package-name-convention.md) | Enforce correct package naming convention for n8n community nodes | ✅ ☑️ | | | 💡 | |
|
|
83
|
+
| [require-community-node-keyword](docs/rules/require-community-node-keyword.md) | Require the "n8n-community-node-package" keyword in community node package.json | | ✅ ☑️ | 🔧 | | |
|
|
84
|
+
| [require-continue-on-fail](docs/rules/require-continue-on-fail.md) | Require continueOnFail() handling in execute() methods of node classes | ✅ ☑️ | | | | |
|
|
85
|
+
| [require-node-api-error](docs/rules/require-node-api-error.md) | Require NodeApiError or NodeOperationError for error wrapping in catch blocks. Raw errors lose HTTP context in the n8n UI. | ✅ ☑️ | | | | |
|
|
86
|
+
| [require-node-description-fields](docs/rules/require-node-description-fields.md) | Node class description must define all required fields: icon, subtitle | ✅ ☑️ | | | | |
|
|
87
|
+
| [require-version](docs/rules/require-version.md) | Require a valid "version" field in community node package.json | ✅ ☑️ | | | | |
|
|
88
|
+
| [resource-operation-pattern](docs/rules/resource-operation-pattern.md) | Enforce proper resource/operation pattern for better UX in n8n nodes | | ✅ ☑️ | | | |
|
|
89
|
+
| [valid-author](docs/rules/valid-author.md) | Require a non-empty author name and email in package.json | ✅ ☑️ | | | | |
|
|
90
|
+
| [valid-credential-references](docs/rules/valid-credential-references.md) | Ensure credentials referenced in node descriptions exist as credential classes in the package | ✅ ☑️ | | | 💡 | |
|
|
91
|
+
| [valid-description](docs/rules/valid-description.md) | Require a non-empty "description" field in community node package.json | ✅ ☑️ | | | | |
|
|
92
|
+
| [valid-peer-dependencies](docs/rules/valid-peer-dependencies.md) | Require community node package.json peerDependencies to contain only "n8n-workflow": "*" (and optionally "@n8n/ai-node-sdk") | ✅ ☑️ | | 🔧 | | |
|
|
93
|
+
| [webhook-lifecycle-complete](docs/rules/webhook-lifecycle-complete.md) | Require webhook trigger nodes to implement the complete webhookMethods lifecycle (checkExists, create, delete) | ✅ ☑️ | | | | |
|
|
93
94
|
|
|
94
95
|
<!-- end auto-generated rules list -->
|
package/dist/plugin.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ declare const configs: {
|
|
|
42
42
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
43
43
|
'@n8n/community-nodes/cred-filename-against-convention': "error";
|
|
44
44
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
45
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': "error";
|
|
45
46
|
'@n8n/community-nodes/node-filename-against-convention': "error";
|
|
46
47
|
'@n8n/community-nodes/missing-paired-item': "error";
|
|
47
48
|
'@n8n/community-nodes/no-builder-hint-leakage': "error";
|
|
@@ -98,6 +99,7 @@ declare const configs: {
|
|
|
98
99
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
99
100
|
'@n8n/community-nodes/cred-filename-against-convention': "error";
|
|
100
101
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
102
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': "error";
|
|
101
103
|
'@n8n/community-nodes/node-filename-against-convention': "error";
|
|
102
104
|
'@n8n/community-nodes/missing-paired-item': "error";
|
|
103
105
|
'@n8n/community-nodes/no-builder-hint-leakage': "error";
|
|
@@ -159,6 +161,7 @@ declare const pluginWithConfigs: {
|
|
|
159
161
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
160
162
|
'@n8n/community-nodes/cred-filename-against-convention': "error";
|
|
161
163
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
164
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': "error";
|
|
162
165
|
'@n8n/community-nodes/node-filename-against-convention': "error";
|
|
163
166
|
'@n8n/community-nodes/missing-paired-item': "error";
|
|
164
167
|
'@n8n/community-nodes/no-builder-hint-leakage': "error";
|
|
@@ -215,6 +218,7 @@ declare const pluginWithConfigs: {
|
|
|
215
218
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
216
219
|
'@n8n/community-nodes/cred-filename-against-convention': "error";
|
|
217
220
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
221
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': "error";
|
|
218
222
|
'@n8n/community-nodes/node-filename-against-convention': "error";
|
|
219
223
|
'@n8n/community-nodes/missing-paired-item': "error";
|
|
220
224
|
'@n8n/community-nodes/no-builder-hint-leakage': "error";
|
|
@@ -283,6 +287,7 @@ declare const n8nCommunityNodesPlugin: {
|
|
|
283
287
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
284
288
|
'@n8n/community-nodes/cred-filename-against-convention': "error";
|
|
285
289
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
290
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': "error";
|
|
286
291
|
'@n8n/community-nodes/node-filename-against-convention': "error";
|
|
287
292
|
'@n8n/community-nodes/missing-paired-item': "error";
|
|
288
293
|
'@n8n/community-nodes/no-builder-hint-leakage': "error";
|
|
@@ -339,6 +344,7 @@ declare const n8nCommunityNodesPlugin: {
|
|
|
339
344
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
340
345
|
'@n8n/community-nodes/cred-filename-against-convention': "error";
|
|
341
346
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
347
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': "error";
|
|
342
348
|
'@n8n/community-nodes/node-filename-against-convention': "error";
|
|
343
349
|
'@n8n/community-nodes/missing-paired-item': "error";
|
|
344
350
|
'@n8n/community-nodes/no-builder-hint-leakage': "error";
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAG7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAYzC,QAAA,MAAM,OAAO;;;;;;;;;;uBAHI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAG7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAYzC,QAAA,MAAM,OAAO;;;;;;;;;;uBAHI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GE,CAAC;AAE1C,QAAA,MAAM,iBAAiB;;;;;;;;;;;2BA5GN,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;CA4GiC,CAAC;AAEzE,QAAA,MAAM,uBAAuB;;;;;;;;;;;2BA9GZ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;CA8GU,CAAC;AAClD,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -44,6 +44,7 @@ const configs = {
|
|
|
44
44
|
'@n8n/community-nodes/cred-class-oauth2-naming': 'error',
|
|
45
45
|
'@n8n/community-nodes/cred-filename-against-convention': 'error',
|
|
46
46
|
'@n8n/community-nodes/node-connection-type-literal': 'error',
|
|
47
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': 'error',
|
|
47
48
|
'@n8n/community-nodes/node-filename-against-convention': 'error',
|
|
48
49
|
'@n8n/community-nodes/missing-paired-item': 'error',
|
|
49
50
|
'@n8n/community-nodes/no-builder-hint-leakage': 'error',
|
|
@@ -93,6 +94,7 @@ const configs = {
|
|
|
93
94
|
'@n8n/community-nodes/cred-class-oauth2-naming': 'error',
|
|
94
95
|
'@n8n/community-nodes/cred-filename-against-convention': 'error',
|
|
95
96
|
'@n8n/community-nodes/node-connection-type-literal': 'error',
|
|
97
|
+
'@n8n/community-nodes/node-class-description-name-camelcase': 'error',
|
|
96
98
|
'@n8n/community-nodes/node-filename-against-convention': 'error',
|
|
97
99
|
'@n8n/community-nodes/missing-paired-item': 'error',
|
|
98
100
|
'@n8n/community-nodes/no-builder-hint-leakage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,EAAE,OAAO;YACvD,iDAAiD,EAAE,OAAO;SAC1D;KACD;CACuC,CAAC;AAE1C,MAAM,iBAAiB,GAAG,EAAE,GAAG,MAAM,EAAE,OAAO,EAA0B,CAAC;AAEzE,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAClD,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-node-package-json.d.ts","sourceRoot":"","sources":["../../src/rules/ai-node-package-json.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ai-node-package-json.d.ts","sourceRoot":"","sources":["../../src/rules/ai-node-package-json.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,iNA2FhC,CAAC"}
|
|
@@ -8,8 +8,8 @@ export const AiNodePackageJsonRule = createRule({
|
|
|
8
8
|
description: 'Enforce consistency between n8n.aiNodeSdkVersion and ai-node-sdk peer dependency in community node packages',
|
|
9
9
|
},
|
|
10
10
|
messages: {
|
|
11
|
-
missingPeerDep: 'Package declares "n8n.aiNodeSdkVersion" but is missing "ai-node-sdk" in peerDependencies. Add "ai-node-sdk": "*" to peerDependencies.',
|
|
12
|
-
missingSdkVersion: 'Package has "ai-node-sdk" in peerDependencies but is missing "aiNodeSdkVersion" in the "n8n" section of package.json.',
|
|
11
|
+
missingPeerDep: 'Package declares "n8n.aiNodeSdkVersion" but is missing "@n8n/ai-node-sdk" in peerDependencies. Add "@n8n/ai-node-sdk": "*" to peerDependencies.',
|
|
12
|
+
missingSdkVersion: 'Package has "@n8n/ai-node-sdk" in peerDependencies but is missing "aiNodeSdkVersion" in the "n8n" section of package.json.',
|
|
13
13
|
invalidSdkVersion: '"n8n.aiNodeSdkVersion" must be a positive integer, got {{ value }}.',
|
|
14
14
|
wrongLocation: '"aiNodeSdkVersion" must be inside the "n8n" section, not at the root level of package.json.',
|
|
15
15
|
},
|
|
@@ -35,7 +35,8 @@ export const AiNodePackageJsonRule = createRule({
|
|
|
35
35
|
const peerDependenciesProp = findJsonProperty(node, 'peerDependencies');
|
|
36
36
|
const hasAiNodeSdkVersion = aiNodeSdkVersionProp !== null;
|
|
37
37
|
const hasAiNodeSdkPeerDep = peerDependenciesProp?.value.type === AST_NODE_TYPES.ObjectExpression &&
|
|
38
|
-
findJsonProperty(peerDependenciesProp.value, 'ai-node-sdk') !== null
|
|
38
|
+
(findJsonProperty(peerDependenciesProp.value, '@n8n/ai-node-sdk') !== null ||
|
|
39
|
+
findJsonProperty(peerDependenciesProp.value, 'ai-node-sdk') !== null);
|
|
39
40
|
// Catch aiNodeSdkVersion placed at root level instead of inside n8n
|
|
40
41
|
if (rootAiNodeSdkVersionProp) {
|
|
41
42
|
context.report({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-node-package-json.js","sourceRoot":"","sources":["../../src/rules/ai-node-package-json.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC/C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACL,WAAW,EACV,6GAA6G;SAC9G;QACD,QAAQ,EAAE;YACT,cAAc,EACb,
|
|
1
|
+
{"version":3,"file":"ai-node-package-json.js","sourceRoot":"","sources":["../../src/rules/ai-node-package-json.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC/C,IAAI,EAA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D,CAAC;IACH,CAAC;CACD,CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAC,KAAc;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/rules/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare const rules: {
|
|
|
24
24
|
allowSlugs?: boolean;
|
|
25
25
|
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
26
26
|
'node-class-description-icon-missing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingIcon" | "addPlaceholder", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
27
|
+
'node-class-description-name-camelcase': import("@typescript-eslint/utils/ts-eslint").RuleModule<"notCamelCase", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
27
28
|
'cred-class-field-icon-missing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingIcon" | "addPlaceholder", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
28
29
|
'cred-class-name-field-conventions': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingSuffix" | "uppercaseFirstChar", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
29
30
|
'cred-class-name-suffix': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingSuffix", [], 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":"AAgDA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CuB,CAAC"}
|
package/dist/rules/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { NoRestrictedImportsRule } from './no-restricted-imports.js';
|
|
|
24
24
|
import { NoRuntimeDependenciesRule } from './no-runtime-dependencies.js';
|
|
25
25
|
import { NoTemplatePlaceholdersRule } from './no-template-placeholders.js';
|
|
26
26
|
import { NodeClassDescriptionIconMissingRule } from './node-class-description-icon-missing.js';
|
|
27
|
+
import { NodeClassDescriptionNameCamelCaseRule } from './node-class-description-name-camelcase.js';
|
|
27
28
|
import { NodeConnectionTypeLiteralRule } from './node-connection-type-literal.js';
|
|
28
29
|
import { NodeFilenameAgainstConventionRule } from './node-filename-against-convention.js';
|
|
29
30
|
import { NodeOperationErrorItemIndexRule } from './node-operation-error-itemindex.js';
|
|
@@ -65,6 +66,7 @@ export const rules = {
|
|
|
65
66
|
'resource-operation-pattern': ResourceOperationPatternRule,
|
|
66
67
|
'credential-documentation-url': CredentialDocumentationUrlRule,
|
|
67
68
|
'node-class-description-icon-missing': NodeClassDescriptionIconMissingRule,
|
|
69
|
+
'node-class-description-name-camelcase': NodeClassDescriptionNameCamelCaseRule,
|
|
68
70
|
'cred-class-field-icon-missing': CredClassFieldIconMissingRule,
|
|
69
71
|
'cred-class-name-field-conventions': CredClassNameFieldConventionsRule,
|
|
70
72
|
'cred-class-name-suffix': CredClassNameSuffixRule,
|
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,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,iCAAiC,EAA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pD,0BAA0B,EAAE,0BAA0B;IACtD,qBAAqB,EAAE,qBAAqB;IAC5C,wBAAwB,EAAE,wBAAwB;IAClD,gCAAgC,EAAE,+BAA+B;IACjE,kCAAkC,EAAE,+BAA+B;IACnE,oBAAoB,EAAE,oBAAoB;IAC1C,yBAAyB,EAAE,yBAAyB;IACpD,0BAA0B,EAAE,0BAA0B;IACtD,iBAAiB,EAAE,kBAAkB;IACrC,6BAA6B,EAAE,4BAA4B;IAC3D,4BAA4B,EAAE,4BAA4B;IAC1D,8BAA8B,EAAE,8BAA8B;IAC9D,qCAAqC,EAAE,mCAAmC;IAC1E,uCAAuC,EAAE,qCAAqC;IAC9E,+BAA+B,EAAE,6BAA6B;IAC9D,mCAAmC,EAAE,iCAAiC;IACtE,wBAAwB,EAAE,uBAAuB;IACjD,0BAA0B,EAAE,yBAAyB;IACrD,kCAAkC,EAAE,iCAAiC;IACrE,8BAA8B,EAAE,6BAA6B;IAC7D,kCAAkC,EAAE,iCAAiC;IACrE,gCAAgC,EAAE,+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 @@
|
|
|
1
|
+
{"version":3,"file":"node-class-description-name-camelcase.d.ts","sourceRoot":"","sources":["../../src/rules/node-class-description-name-camelcase.ts"],"names":[],"mappings":"AAiDA,eAAO,MAAM,qCAAqC,iJAgEhD,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
import { isNodeTypeClass, findClassProperty, findObjectProperty, getStringLiteralValue, isFileType, createRule, } from '../utils/index.js';
|
|
3
|
+
// `description.name` must be camelCase: a lowercase letter followed by
|
|
4
|
+
// letters/digits, with no separators.
|
|
5
|
+
const CAMEL_CASE_PATTERN = /^[a-z][a-zA-Z0-9]*$/;
|
|
6
|
+
/**
|
|
7
|
+
* Converts an arbitrary node name to camelCase by splitting on any
|
|
8
|
+
* non-alphanumeric separators, upper-casing the first character of each
|
|
9
|
+
* subsequent segment, and lower-casing the very first character.
|
|
10
|
+
* Examples: `My Node` -> `myNode`, `my-node` -> `myNode`, `GitHub` -> `gitHub`.
|
|
11
|
+
*/
|
|
12
|
+
function toCamelCase(value) {
|
|
13
|
+
const segments = value.split(/[^a-zA-Z0-9]+/).filter(Boolean);
|
|
14
|
+
if (segments.length === 0) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
const joined = segments
|
|
18
|
+
.map((segment, index) => index === 0 ? segment : segment.charAt(0).toUpperCase() + segment.slice(1))
|
|
19
|
+
.join('');
|
|
20
|
+
return joined.charAt(0).toLowerCase() + joined.slice(1);
|
|
21
|
+
}
|
|
22
|
+
// Serialize a value as a string literal using the original quote character,
|
|
23
|
+
// escaping any characters that would otherwise break the literal so the
|
|
24
|
+
// autofix never emits invalid code.
|
|
25
|
+
function toStringLiteral(value, quote) {
|
|
26
|
+
const escaped = value
|
|
27
|
+
.replace(/\\/g, '\\\\')
|
|
28
|
+
.replace(/\n/g, '\\n')
|
|
29
|
+
.replace(/\r/g, '\\r')
|
|
30
|
+
.split(quote)
|
|
31
|
+
.join(`\\${quote}`);
|
|
32
|
+
return `${quote}${escaped}${quote}`;
|
|
33
|
+
}
|
|
34
|
+
export const NodeClassDescriptionNameCamelCaseRule = createRule({
|
|
35
|
+
name: 'node-class-description-name-camelcase',
|
|
36
|
+
meta: {
|
|
37
|
+
type: 'problem',
|
|
38
|
+
docs: {
|
|
39
|
+
description: 'Node class `description.name` must be camelCase',
|
|
40
|
+
},
|
|
41
|
+
messages: {
|
|
42
|
+
notCamelCase: "Node `description.name` '{{value}}' must be camelCase",
|
|
43
|
+
},
|
|
44
|
+
fixable: 'code',
|
|
45
|
+
schema: [],
|
|
46
|
+
},
|
|
47
|
+
defaultOptions: [],
|
|
48
|
+
create(context) {
|
|
49
|
+
if (!isFileType(context.filename, '.node.ts')) {
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
ClassDeclaration(node) {
|
|
54
|
+
if (!isNodeTypeClass(node)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const descriptionProperty = findClassProperty(node, 'description');
|
|
58
|
+
if (descriptionProperty?.value?.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const nameProperty = findObjectProperty(descriptionProperty.value, 'name');
|
|
62
|
+
if (!nameProperty) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const nameValue = getStringLiteralValue(nameProperty.value);
|
|
66
|
+
if (nameValue === null) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (CAMEL_CASE_PATTERN.test(nameValue)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const valueNode = nameProperty.value;
|
|
73
|
+
const fixedValue = toCamelCase(nameValue);
|
|
74
|
+
// Only offer an autofix when it actually yields a valid camelCase
|
|
75
|
+
// value (e.g. names starting with a digit cannot be repaired).
|
|
76
|
+
const canFix = fixedValue !== nameValue && CAMEL_CASE_PATTERN.test(fixedValue);
|
|
77
|
+
context.report({
|
|
78
|
+
node: valueNode,
|
|
79
|
+
messageId: 'notCamelCase',
|
|
80
|
+
data: { value: nameValue },
|
|
81
|
+
fix: canFix
|
|
82
|
+
? (fixer) => {
|
|
83
|
+
const quote = context.sourceCode.getText(valueNode).charAt(0);
|
|
84
|
+
return fixer.replaceText(valueNode, toStringLiteral(fixedValue, quote));
|
|
85
|
+
}
|
|
86
|
+
: undefined,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=node-class-description-name-camelcase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-class-description-name-camelcase.js","sourceRoot":"","sources":["../../src/rules/node-class-description-name-camelcase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,UAAU,GACV,MAAM,mBAAmB,CAAC;AAE3B,uEAAuE;AACvE,sCAAsC;AACtC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEjD;;;;;GAKG;AACH,SAAS,WAAW,CAAC,KAAa;IACjC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ;SACrB,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACvB,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAC1E;SACA,IAAI,CAAC,EAAE,CAAC,CAAC;IAEX,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC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E,IAAI,CAAC,YAAY,EAAE,CAAC;oBACnB,OAAO;gBACR,CAAC;gBAED,MAAM,SAAS,GAAG,qBAAqB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBAC5D,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;oBACxB,OAAO;gBACR,CAAC;gBAED,IAAI,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;oBACxC,OAAO;gBACR,CAAC;gBAED,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC;gBACrC,MAAM,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;gBAC1C,kEAAkE;gBAClE,+DAA+D;gBAC/D,MAAM,MAAM,GAAG,UAAU,KAAK,SAAS,IAAI,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/E,OAAO,CAAC,MAAM,CAAC;oBACd,IAAI,EAAE,SAAS;oBACf,SAAS,EAAE,cAAc;oBACzB,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;oBAC1B,GAAG,EAAE,MAAM;wBACV,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;4BACV,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;4BAC9D,OAAO,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,eAAe,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;wBACzE,CAAC;wBACF,CAAC,CAAC,SAAS;iBACZ,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valid-peer-dependencies.d.ts","sourceRoot":"","sources":["../../src/rules/valid-peer-dependencies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"valid-peer-dependencies.d.ts","sourceRoot":"","sources":["../../src/rules/valid-peer-dependencies.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,yBAAyB,qQA0GpC,CAAC"}
|
|
@@ -2,13 +2,15 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
|
2
2
|
import { createRule, findJsonProperty } from '../utils/index.js';
|
|
3
3
|
const REQUIRED_DEP = 'n8n-workflow';
|
|
4
4
|
const REQUIRED_VERSION = '*';
|
|
5
|
-
|
|
5
|
+
// The published SDK is scoped (@n8n/ai-node-sdk); the unscoped name is kept for
|
|
6
|
+
// backwards compatibility, mirroring no-restricted-imports.
|
|
7
|
+
const ALLOWED_DEPS = new Set([REQUIRED_DEP, '@n8n/ai-node-sdk', 'ai-node-sdk']);
|
|
6
8
|
export const ValidPeerDependenciesRule = createRule({
|
|
7
9
|
name: 'valid-peer-dependencies',
|
|
8
10
|
meta: {
|
|
9
11
|
type: 'problem',
|
|
10
12
|
docs: {
|
|
11
|
-
description: 'Require community node package.json peerDependencies to contain only "n8n-workflow": "*" (and optionally "ai-node-sdk")',
|
|
13
|
+
description: 'Require community node package.json peerDependencies to contain only "n8n-workflow": "*" (and optionally "@n8n/ai-node-sdk")',
|
|
12
14
|
},
|
|
13
15
|
fixable: 'code',
|
|
14
16
|
messages: {
|
|
@@ -16,7 +18,7 @@ export const ValidPeerDependenciesRule = createRule({
|
|
|
16
18
|
invalidPeerDependenciesType: `"peerDependencies" must be an object mapping package names to version ranges (containing "${REQUIRED_DEP}": "${REQUIRED_VERSION}").`,
|
|
17
19
|
missingN8nWorkflow: `"peerDependencies" must include "${REQUIRED_DEP}": "${REQUIRED_VERSION}".`,
|
|
18
20
|
pinnedN8nWorkflow: `"peerDependencies.${REQUIRED_DEP}" must be "${REQUIRED_VERSION}", got {{ value }}.`,
|
|
19
|
-
forbiddenPeerDependency: '"{{ name }}" is not allowed in "peerDependencies". Only "n8n-workflow" and "ai-node-sdk" are permitted.',
|
|
21
|
+
forbiddenPeerDependency: '"{{ name }}" is not allowed in "peerDependencies". Only "n8n-workflow" and "@n8n/ai-node-sdk" are permitted.',
|
|
20
22
|
},
|
|
21
23
|
schema: [],
|
|
22
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valid-peer-dependencies.js","sourceRoot":"","sources":["../../src/rules/valid-peer-dependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"valid-peer-dependencies.js","sourceRoot":"","sources":["../../src/rules/valid-peer-dependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,gFAAgF;AAChF,4DAA4D;AAC5D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,kBAAkB,EAAE,aAAa,CAAC,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC;IACnD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACL,WAAW,EACV,8HAA8H;SAC/H;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACT,uBAAuB,EAAE,uEAAuE,YAAY,OAAO,gBAAgB,IAAI;YACvI,2BAA2B,EAAE,6FAA6F,YAAY,OAAO,gBAAgB,KAAK;YAClK,kBAAkB,EAAE,oCAAoC,YA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