@n8n/eslint-plugin-community-nodes 0.18.0 β 0.20.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 +38 -36
- 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/cred-class-name-field-conventions.d.ts +2 -0
- package/dist/rules/cred-class-name-field-conventions.d.ts.map +1 -0
- package/dist/rules/cred-class-name-field-conventions.js +89 -0
- package/dist/rules/cred-class-name-field-conventions.js.map +1 -0
- package/dist/rules/credential-password-field.js +1 -1
- package/dist/rules/index.d.ts +2 -1
- 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/no-credential-reuse.js +1 -1
- package/dist/rules/no-restricted-globals.js +1 -1
- package/dist/rules/no-template-placeholders.d.ts.map +1 -1
- package/dist/rules/no-template-placeholders.js +3 -1
- package/dist/rules/no-template-placeholders.js.map +1 -1
- package/dist/rules/node-usable-as-tool.js +1 -1
- package/dist/rules/package-name-convention.d.ts +1 -1
- package/dist/rules/package-name-convention.d.ts.map +1 -1
- package/dist/rules/package-name-convention.js +19 -0
- package/dist/rules/package-name-convention.js.map +1 -1
- package/dist/rules/require-node-api-error.d.ts +2 -1
- package/dist/rules/require-node-api-error.d.ts.map +1 -1
- package/dist/rules/require-node-api-error.js +2 -3
- package/dist/rules/require-node-api-error.js.map +1 -1
- package/dist/rules/valid-credential-references.js +1 -1
- package/docs/rules/cred-class-name-field-conventions.md +38 -0
- package/docs/rules/no-builder-hint-leakage.md +38 -0
- package/docs/rules/package-name-convention.md +14 -0
- package/package.json +7 -5
- package/src/plugin.ts +2 -0
- package/src/rules/cred-class-name-field-conventions.test.ts +121 -0
- package/src/rules/cred-class-name-field-conventions.ts +102 -0
- package/src/rules/credential-password-field.ts +1 -1
- package/src/rules/index.ts +2 -0
- package/src/rules/no-credential-reuse.ts +1 -1
- package/src/rules/no-restricted-globals.ts +1 -1
- package/src/rules/no-template-placeholders.test.ts +18 -0
- package/src/rules/no-template-placeholders.ts +3 -1
- package/src/rules/node-usable-as-tool.ts +1 -1
- package/src/rules/package-name-convention.test.ts +32 -5
- package/src/rules/package-name-convention.ts +23 -0
- package/src/rules/require-node-api-error.ts +4 -3
- package/src/rules/valid-credential-references.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/.turbo/turbo-build.log +0 -4
package/README.md
CHANGED
|
@@ -44,41 +44,43 @@ 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Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β | 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-
|
|
52
|
-
| [cred-class-
|
|
53
|
-
| [
|
|
54
|
-
| [credential-
|
|
55
|
-
| [credential-
|
|
56
|
-
| [
|
|
57
|
-
| [
|
|
58
|
-
| [
|
|
59
|
-
| [
|
|
60
|
-
| [no-
|
|
61
|
-
| [no-
|
|
62
|
-
| [no-
|
|
63
|
-
| [no-
|
|
64
|
-
| [no-
|
|
65
|
-
| [no-
|
|
66
|
-
| [no-
|
|
67
|
-
| [no-
|
|
68
|
-
| [
|
|
69
|
-
| [
|
|
70
|
-
| [node-
|
|
71
|
-
| [node-
|
|
72
|
-
| [
|
|
73
|
-
| [
|
|
74
|
-
| [
|
|
75
|
-
| [
|
|
76
|
-
| [require-node-
|
|
77
|
-
| [require-
|
|
78
|
-
| [
|
|
79
|
-
| [
|
|
80
|
-
| [
|
|
81
|
-
| [valid-
|
|
82
|
-
| [
|
|
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
|
+
| [credential-documentation-url](docs/rules/credential-documentation-url.md) | Enforce valid credential documentationUrl format (URL or lowercase alphanumeric slug) | β
βοΈ | | π§ | | |
|
|
55
|
+
| [credential-password-field](docs/rules/credential-password-field.md) | Ensure credential fields with sensitive names have typeOptions.password = true | β
βοΈ | | π§ | | |
|
|
56
|
+
| [credential-test-required](docs/rules/credential-test-required.md) | Ensure credentials have a credential test | β
βοΈ | | | π‘ | |
|
|
57
|
+
| [icon-validation](docs/rules/icon-validation.md) | Validate node and credential icon files exist, are SVG format, and light/dark icons are different | β
βοΈ | | | π‘ | |
|
|
58
|
+
| [missing-paired-item](docs/rules/missing-paired-item.md) | Require pairedItem on INodeExecutionData objects in execute() methods to preserve item linking. | β
βοΈ | | | | |
|
|
59
|
+
| [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) | β
βοΈ | | | | |
|
|
60
|
+
| [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. | β
βοΈ | | | | |
|
|
61
|
+
| [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 | β
βοΈ | | | π‘ | |
|
|
62
|
+
| [no-deprecated-workflow-functions](docs/rules/no-deprecated-workflow-functions.md) | Disallow usage of deprecated functions and types from n8n-workflow package | β
βοΈ | | | π‘ | |
|
|
63
|
+
| [no-forbidden-lifecycle-scripts](docs/rules/no-forbidden-lifecycle-scripts.md) | Ban lifecycle scripts (prepare, preinstall, postinstall, etc.) in community node packages | β
βοΈ | | | | |
|
|
64
|
+
| [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. | β
βοΈ | | | | |
|
|
65
|
+
| [no-overrides-field](docs/rules/no-overrides-field.md) | Ban the "overrides" field in community node package.json | β
βοΈ | | | | |
|
|
66
|
+
| [no-restricted-globals](docs/rules/no-restricted-globals.md) | Disallow usage of restricted global variables in community nodes. | β
| | | | |
|
|
67
|
+
| [no-restricted-imports](docs/rules/no-restricted-imports.md) | Disallow usage of restricted imports in community nodes. | β
| | | | |
|
|
68
|
+
| [no-runtime-dependencies](docs/rules/no-runtime-dependencies.md) | Disallow non-empty "dependencies" in community node package.json | β
βοΈ | | | | |
|
|
69
|
+
| [no-template-placeholders](docs/rules/no-template-placeholders.md) | Disallow unresolved template placeholders in package.json | β
βοΈ | | | | |
|
|
70
|
+
| [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. | | | | π‘ | β |
|
|
71
|
+
| [node-connection-type-literal](docs/rules/node-connection-type-literal.md) | Disallow string literals in node description `inputs`/`outputs` β use `NodeConnectionTypes` enum instead | β
βοΈ | | π§ | | |
|
|
72
|
+
| [node-operation-error-itemindex](docs/rules/node-operation-error-itemindex.md) | Require { itemIndex } in NodeOperationError / NodeApiError options inside item loops | β
βοΈ | | | | |
|
|
73
|
+
| [node-usable-as-tool](docs/rules/node-usable-as-tool.md) | Ensure node classes have usableAsTool property | β
βοΈ | | π§ | | |
|
|
74
|
+
| [options-sorted-alphabetically](docs/rules/options-sorted-alphabetically.md) | Enforce alphabetical ordering of options arrays in n8n node properties | | β
βοΈ | | | |
|
|
75
|
+
| [package-name-convention](docs/rules/package-name-convention.md) | Enforce correct package naming convention for n8n community nodes | β
βοΈ | | | π‘ | |
|
|
76
|
+
| [require-community-node-keyword](docs/rules/require-community-node-keyword.md) | Require the "n8n-community-node-package" keyword in community node package.json | | β
βοΈ | π§ | | |
|
|
77
|
+
| [require-continue-on-fail](docs/rules/require-continue-on-fail.md) | Require continueOnFail() handling in execute() methods of node classes | β
βοΈ | | | | |
|
|
78
|
+
| [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. | β
βοΈ | | | | |
|
|
79
|
+
| [require-node-description-fields](docs/rules/require-node-description-fields.md) | Node class description must define all required fields: icon, subtitle | β
βοΈ | | | | |
|
|
80
|
+
| [resource-operation-pattern](docs/rules/resource-operation-pattern.md) | Enforce proper resource/operation pattern for better UX in n8n nodes | | β
βοΈ | | | |
|
|
81
|
+
| [valid-credential-references](docs/rules/valid-credential-references.md) | Ensure credentials referenced in node descriptions exist as credential classes in the package | β
βοΈ | | | π‘ | |
|
|
82
|
+
| [valid-description](docs/rules/valid-description.md) | Require a non-empty "description" field in community node package.json | β
βοΈ | | | | |
|
|
83
|
+
| [valid-peer-dependencies](docs/rules/valid-peer-dependencies.md) | Require community node package.json peerDependencies to contain only "n8n-workflow": "*" (and optionally "ai-node-sdk") | β
βοΈ | | π§ | | |
|
|
84
|
+
| [webhook-lifecycle-complete](docs/rules/webhook-lifecycle-complete.md) | Require webhook trigger nodes to implement the complete webhookMethods lifecycle (checkExists, create, delete) | β
βοΈ | | | | |
|
|
83
85
|
|
|
84
86
|
<!-- end auto-generated rules list -->
|
package/dist/plugin.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ declare const configs: {
|
|
|
34
34
|
'@n8n/community-nodes/resource-operation-pattern': "warn";
|
|
35
35
|
'@n8n/community-nodes/credential-documentation-url': "error";
|
|
36
36
|
'@n8n/community-nodes/cred-class-field-icon-missing': "error";
|
|
37
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': "error";
|
|
37
38
|
'@n8n/community-nodes/cred-class-name-suffix': "error";
|
|
38
39
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
39
40
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
@@ -81,6 +82,7 @@ declare const configs: {
|
|
|
81
82
|
'@n8n/community-nodes/credential-documentation-url': "error";
|
|
82
83
|
'@n8n/community-nodes/resource-operation-pattern': "warn";
|
|
83
84
|
'@n8n/community-nodes/cred-class-field-icon-missing': "error";
|
|
85
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': "error";
|
|
84
86
|
'@n8n/community-nodes/cred-class-name-suffix': "error";
|
|
85
87
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
86
88
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
@@ -133,6 +135,7 @@ declare const pluginWithConfigs: {
|
|
|
133
135
|
'@n8n/community-nodes/resource-operation-pattern': "warn";
|
|
134
136
|
'@n8n/community-nodes/credential-documentation-url': "error";
|
|
135
137
|
'@n8n/community-nodes/cred-class-field-icon-missing': "error";
|
|
138
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': "error";
|
|
136
139
|
'@n8n/community-nodes/cred-class-name-suffix': "error";
|
|
137
140
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
138
141
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
@@ -180,6 +183,7 @@ declare const pluginWithConfigs: {
|
|
|
180
183
|
'@n8n/community-nodes/credential-documentation-url': "error";
|
|
181
184
|
'@n8n/community-nodes/resource-operation-pattern': "warn";
|
|
182
185
|
'@n8n/community-nodes/cred-class-field-icon-missing': "error";
|
|
186
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': "error";
|
|
183
187
|
'@n8n/community-nodes/cred-class-name-suffix': "error";
|
|
184
188
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
185
189
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
@@ -239,6 +243,7 @@ declare const n8nCommunityNodesPlugin: {
|
|
|
239
243
|
'@n8n/community-nodes/resource-operation-pattern': "warn";
|
|
240
244
|
'@n8n/community-nodes/credential-documentation-url': "error";
|
|
241
245
|
'@n8n/community-nodes/cred-class-field-icon-missing': "error";
|
|
246
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': "error";
|
|
242
247
|
'@n8n/community-nodes/cred-class-name-suffix': "error";
|
|
243
248
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
244
249
|
'@n8n/community-nodes/node-connection-type-literal': "error";
|
|
@@ -286,6 +291,7 @@ declare const n8nCommunityNodesPlugin: {
|
|
|
286
291
|
'@n8n/community-nodes/credential-documentation-url': "error";
|
|
287
292
|
'@n8n/community-nodes/resource-operation-pattern': "warn";
|
|
288
293
|
'@n8n/community-nodes/cred-class-field-icon-missing': "error";
|
|
294
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': "error";
|
|
289
295
|
'@n8n/community-nodes/cred-class-name-suffix': "error";
|
|
290
296
|
'@n8n/community-nodes/cred-class-oauth2-naming': "error";
|
|
291
297
|
'@n8n/community-nodes/node-connection-type-literal': "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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFE,CAAC;AAE1C,QAAA,MAAM,iBAAiB;;;;;;;;;;;2BA1FN,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;CA0FiC,CAAC;AAEzE,QAAA,MAAM,uBAAuB;;;;;;;;;;;2BA5FZ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAtB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;CA4FU,CAAC;AAClD,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -36,6 +36,7 @@ const configs = {
|
|
|
36
36
|
'@n8n/community-nodes/resource-operation-pattern': 'warn',
|
|
37
37
|
'@n8n/community-nodes/credential-documentation-url': 'error',
|
|
38
38
|
'@n8n/community-nodes/cred-class-field-icon-missing': 'error',
|
|
39
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': 'error',
|
|
39
40
|
'@n8n/community-nodes/cred-class-name-suffix': 'error',
|
|
40
41
|
'@n8n/community-nodes/cred-class-oauth2-naming': 'error',
|
|
41
42
|
'@n8n/community-nodes/node-connection-type-literal': 'error',
|
|
@@ -76,6 +77,7 @@ const configs = {
|
|
|
76
77
|
'@n8n/community-nodes/credential-documentation-url': 'error',
|
|
77
78
|
'@n8n/community-nodes/resource-operation-pattern': 'warn',
|
|
78
79
|
'@n8n/community-nodes/cred-class-field-icon-missing': 'error',
|
|
80
|
+
'@n8n/community-nodes/cred-class-name-field-conventions': 'error',
|
|
79
81
|
'@n8n/community-nodes/cred-class-name-suffix': 'error',
|
|
80
82
|
'@n8n/community-nodes/cred-class-oauth2-naming': 'error',
|
|
81
83
|
'@n8n/community-nodes/node-connection-type-literal': 'error',
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxD,OAAO,EAAE,KAAK,E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AC3D,wCAAwC,EAAE,OAAO;YACjD,8CAA8C,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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const CredClassNameFieldConventionsRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingSuffix" | "uppercaseFirstChar", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
|
+
//# sourceMappingURL=cred-class-name-field-conventions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cred-class-name-field-conventions.d.ts","sourceRoot":"","sources":["../../src/rules/cred-class-name-field-conventions.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,iCAAiC,yKAqE5C,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createRule, findClassProperty, getStringLiteralValue, isCredentialTypeClass, isFileType, } from '../utils/index.js';
|
|
2
|
+
function lowercaseFirstChar(name) {
|
|
3
|
+
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
4
|
+
}
|
|
5
|
+
function addApiSuffix(name) {
|
|
6
|
+
if (name.endsWith('Api'))
|
|
7
|
+
return name;
|
|
8
|
+
if (name.endsWith('Ap'))
|
|
9
|
+
return `${name}i`;
|
|
10
|
+
if (name.endsWith('A'))
|
|
11
|
+
return `${name}pi`;
|
|
12
|
+
return `${name}Api`;
|
|
13
|
+
}
|
|
14
|
+
// Serialize a value as a string literal using the original quote character,
|
|
15
|
+
// escaping any characters that would otherwise break the literal so the
|
|
16
|
+
// autofix never emits invalid code (e.g. names containing quotes).
|
|
17
|
+
function toStringLiteral(value, quote) {
|
|
18
|
+
const escaped = value
|
|
19
|
+
.replace(/\\/g, '\\\\')
|
|
20
|
+
.replace(/\n/g, '\\n')
|
|
21
|
+
.replace(/\r/g, '\\r')
|
|
22
|
+
.split(quote)
|
|
23
|
+
.join(`\\${quote}`);
|
|
24
|
+
return `${quote}${escaped}${quote}`;
|
|
25
|
+
}
|
|
26
|
+
export const CredClassNameFieldConventionsRule = createRule({
|
|
27
|
+
name: 'cred-class-name-field-conventions',
|
|
28
|
+
meta: {
|
|
29
|
+
type: 'problem',
|
|
30
|
+
docs: {
|
|
31
|
+
description: 'Credential `name` field must end with `Api` and start with a lowercase letter',
|
|
32
|
+
},
|
|
33
|
+
messages: {
|
|
34
|
+
missingSuffix: "Credential `name` field '{{value}}' must end with 'Api'",
|
|
35
|
+
uppercaseFirstChar: "Credential `name` field '{{value}}' must start with a lowercase letter",
|
|
36
|
+
},
|
|
37
|
+
fixable: 'code',
|
|
38
|
+
schema: [],
|
|
39
|
+
},
|
|
40
|
+
defaultOptions: [],
|
|
41
|
+
create(context) {
|
|
42
|
+
if (!isFileType(context.filename, '.credentials.ts')) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
ClassDeclaration(node) {
|
|
47
|
+
if (!isCredentialTypeClass(node)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const nameProperty = findClassProperty(node, 'name');
|
|
51
|
+
if (!nameProperty?.value) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const nameValue = getStringLiteralValue(nameProperty.value);
|
|
55
|
+
if (nameValue === null) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const startsLowercase = !/^[A-Z]/.test(nameValue);
|
|
59
|
+
const endsWithApi = nameValue.endsWith('Api');
|
|
60
|
+
if (startsLowercase && endsWithApi) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Compute the fully-corrected value once so each fix yields the
|
|
64
|
+
// same result in a single pass, regardless of which one applies.
|
|
65
|
+
const fixedValue = addApiSuffix(lowercaseFirstChar(nameValue));
|
|
66
|
+
const valueNode = nameProperty.value;
|
|
67
|
+
const quote = context.sourceCode.getText(valueNode).charAt(0);
|
|
68
|
+
const replacement = toStringLiteral(fixedValue, quote);
|
|
69
|
+
if (!startsLowercase) {
|
|
70
|
+
context.report({
|
|
71
|
+
node: valueNode,
|
|
72
|
+
messageId: 'uppercaseFirstChar',
|
|
73
|
+
data: { value: nameValue },
|
|
74
|
+
fix: (fixer) => fixer.replaceText(valueNode, replacement),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (!endsWithApi) {
|
|
78
|
+
context.report({
|
|
79
|
+
node: valueNode,
|
|
80
|
+
messageId: 'missingSuffix',
|
|
81
|
+
data: { value: nameValue },
|
|
82
|
+
fix: (fixer) => fixer.replaceText(valueNode, replacement),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=cred-class-name-field-conventions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cred-class-name-field-conventions.js","sourceRoot":"","sources":["../../src/rules/cred-class-name-field-conventions.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,GACV,MAAM,mBAAmB,CAAC;AAE3B,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,SAAS,YAAY,CAAC,IAAY;IACjC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,G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,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC;qBACzD,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TSESTree } from '@typescript-eslint/
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import { isCredentialTypeClass, findClassProperty, findObjectProperty, getStringLiteralValue, getBooleanLiteralValue, createRule, } from '../utils/index.js';
|
|
3
3
|
const SENSITIVE_PATTERNS = [
|
|
4
4
|
'password',
|
package/dist/rules/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const rules: {
|
|
|
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
7
|
'node-usable-as-tool': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingUsableAsTool", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
8
8
|
'options-sorted-alphabetically': import("@typescript-eslint/utils/ts-eslint").RuleModule<"optionsNotSorted", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
|
-
'package-name-convention': import("@typescript-eslint/utils/ts-eslint").RuleModule<"renameTo" | "invalidPackageName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
|
+
'package-name-convention': import("@typescript-eslint/utils/ts-eslint").RuleModule<"renameTo" | "invalidPackageName" | "missingName" | "defaultPlaceholderName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
10
10
|
'credential-test-required': import("@typescript-eslint/utils/ts-eslint").RuleModule<"addTemplate" | "missingCredentialTest", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
11
11
|
'no-credential-reuse': import("@typescript-eslint/utils/ts-eslint").RuleModule<"didYouMean" | "useAvailable" | "credentialNotInPackage", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
12
12
|
'no-forbidden-lifecycle-scripts': import("@typescript-eslint/utils/ts-eslint").RuleModule<"forbiddenScript", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
@@ -22,6 +22,7 @@ export declare const rules: {
|
|
|
22
22
|
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
23
23
|
'node-class-description-icon-missing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingIcon" | "addPlaceholder", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
24
24
|
'cred-class-field-icon-missing': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingIcon" | "addPlaceholder", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
25
|
+
'cred-class-name-field-conventions': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingSuffix" | "uppercaseFirstChar", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
25
26
|
'cred-class-name-suffix': import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingSuffix", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
26
27
|
'cred-class-oauth2-naming': import("@typescript-eslint/utils/ts-eslint").RuleModule<"classNameMissingOAuth2" | "nameMissingOAuth2" | "displayNameMissingOAuth2", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
27
28
|
'node-connection-type-literal': import("@typescript-eslint/utils/ts-eslint").RuleModule<"stringLiteralInInputs" | "stringLiteralInOutputs" | "unknownStringLiteralInInputs" | "unknownStringLiteralInOutputs", [], 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":"AAuCA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCuB,CAAC"}
|
package/dist/rules/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AiNodePackageJsonRule } from './ai-node-package-json.js';
|
|
2
2
|
import { CredClassFieldIconMissingRule } from './cred-class-field-icon-missing.js';
|
|
3
|
+
import { CredClassNameFieldConventionsRule } from './cred-class-name-field-conventions.js';
|
|
3
4
|
import { CredClassNameSuffixRule } from './cred-class-name-suffix.js';
|
|
4
5
|
import { CredClassOAuth2NamingRule } from './cred-class-oauth2-naming.js';
|
|
5
6
|
import { CredentialDocumentationUrlRule } from './credential-documentation-url.js';
|
|
@@ -54,6 +55,7 @@ export const rules = {
|
|
|
54
55
|
'credential-documentation-url': CredentialDocumentationUrlRule,
|
|
55
56
|
'node-class-description-icon-missing': NodeClassDescriptionIconMissingRule,
|
|
56
57
|
'cred-class-field-icon-missing': CredClassFieldIconMissingRule,
|
|
58
|
+
'cred-class-name-field-conventions': CredClassNameFieldConventionsRule,
|
|
57
59
|
'cred-class-name-suffix': CredClassNameSuffixRule,
|
|
58
60
|
'cred-class-oauth2-naming': CredClassOAuth2NamingRule,
|
|
59
61
|
'node-connection-type-literal': NodeConnectionTypeLiteralRule,
|
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,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,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ACrE,qBAAqB,EAAE,oBAAoB;IAC3C,+BAA+B,EAAE,+BAA+B;IAChE,yBAAyB,EAAE,yBAAyB;IACpD,0BAA0B,EAAE,0BAA0B;IACtD,qBAAqB,EAAE,qBAAqB;IAC5C,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,4BAA4B,EAAE,4BAA4B;IAC1D,8BAA8B,EAAE,8BAA8B;IAC9D,qCAAqC,EAAE,mCAAmC;IAC1E,+BAA+B,EAAE,6BAA6B;IAC9D,mCAAmC,EAAE,iCAAiC;IACtE,wBAAwB,EAAE,uBAAuB;IACjD,0BAA0B,EAAE,yBAAyB;IACrD,8BAA8B,EAAE,6BAA6B;IAC7D,gCAAgC,EAAE,+BAA+B;IACjE,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,6BAA6B,EAAE,6BAA6B;IAC5D,mBAAmB,EAAE,oBAAoB;IACzC,yBAAyB,EAAE,yBAAyB;IACpD,4BAA4B,EAAE,4BAA4B;CAClB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TSESTree } from '@typescript-eslint/
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import { isNodeTypeClass, findClassProperty, findArrayLiteralProperty, extractCredentialNameFromArray, findPackageJson, readPackageJsonCredentials, isFileType, findSimilarStrings, createRule, } from '../utils/index.js';
|
|
3
3
|
export const NoCredentialReuseRule = createRule({
|
|
4
4
|
name: 'no-credential-reuse',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-template-placeholders.d.ts","sourceRoot":"","sources":["../../src/rules/no-template-placeholders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-template-placeholders.d.ts","sourceRoot":"","sources":["../../src/rules/no-template-placeholders.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,0BAA0B,0JA+CrC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
2
|
import { createRule } from '../utils/index.js';
|
|
3
|
-
|
|
3
|
+
// Excludes `@` so that emails inside npm "person" strings
|
|
4
|
+
// (e.g. `"author": "Jane Doe <jane@example.com>"`) are not flagged.
|
|
5
|
+
const ANGLE_PLACEHOLDER = /<[^<>\n@]+?>/;
|
|
4
6
|
const MUSTACHE_PLACEHOLDER = /\{\{[^{}\n]+?\}\}/;
|
|
5
7
|
function findPlaceholder(value) {
|
|
6
8
|
const angleMatch = ANGLE_PLACEHOLDER.exec(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-template-placeholders.js","sourceRoot":"","sources":["../../src/rules/no-template-placeholders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"no-template-placeholders.js","sourceRoot":"","sources":["../../src/rules/no-template-placeholders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,0DAA0D;AAC1D,oEAAoE;AACpE,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEjD,SAAS,eAAe,CAAC,KAAa;IACrC,MAAM,UAAU,GAAG,i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CAAC,WAAW,EAAE,CAAC;oBAClB,OAAO;gBACR,CAAC;gBAED,OAAO,CAAC,MAAM,CAAC;oBACd,IAAI;oBACJ,SAAS,EAAE,uBAAuB;oBAClC,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE;iBACtC,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TSESTree } from '@typescript-eslint/
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import { isNodeTypeClass, findClassProperty, findObjectProperty, createRule, } from '../utils/index.js';
|
|
3
3
|
export const NodeUsableAsToolRule = createRule({
|
|
4
4
|
name: 'node-usable-as-tool',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PackageNameConventionRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"renameTo" | "invalidPackageName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
1
|
+
export declare const PackageNameConventionRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"renameTo" | "invalidPackageName" | "missingName" | "defaultPlaceholderName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
2
2
|
//# sourceMappingURL=package-name-convention.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-name-convention.d.ts","sourceRoot":"","sources":["../../src/rules/package-name-convention.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"package-name-convention.d.ts","sourceRoot":"","sources":["../../src/rules/package-name-convention.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,+MAwFpC,CAAC"}
|
|
@@ -10,6 +10,8 @@ export const PackageNameConventionRule = createRule({
|
|
|
10
10
|
messages: {
|
|
11
11
|
renameTo: "Rename to '{{suggestedName}}'",
|
|
12
12
|
invalidPackageName: 'Package name "{{ packageName }}" must follow the convention "n8n-nodes-[PACKAGE-NAME]" or "@[AUTHOR]/n8n-nodes-[PACKAGE-NAME]"',
|
|
13
|
+
missingName: 'Package name is missing. Add a "name" field following the convention "n8n-nodes-[PACKAGE-NAME]" or "@[AUTHOR]/n8n-nodes-[PACKAGE-NAME]"',
|
|
14
|
+
defaultPlaceholderName: 'Package name "{{ packageName }}" still contains the default placeholder. Replace "<...>" with your package name',
|
|
13
15
|
},
|
|
14
16
|
schema: [],
|
|
15
17
|
hasSuggestions: true,
|
|
@@ -26,6 +28,10 @@ export const PackageNameConventionRule = createRule({
|
|
|
26
28
|
}
|
|
27
29
|
const nameProperty = findJsonProperty(node, 'name');
|
|
28
30
|
if (!nameProperty) {
|
|
31
|
+
context.report({
|
|
32
|
+
node,
|
|
33
|
+
messageId: 'missingName',
|
|
34
|
+
});
|
|
29
35
|
return;
|
|
30
36
|
}
|
|
31
37
|
if (nameProperty.value.type !== AST_NODE_TYPES.Literal) {
|
|
@@ -33,6 +39,16 @@ export const PackageNameConventionRule = createRule({
|
|
|
33
39
|
}
|
|
34
40
|
const packageName = nameProperty.value.value;
|
|
35
41
|
const packageNameStr = typeof packageName === 'string' ? packageName : null;
|
|
42
|
+
if (packageNameStr && isDefaultPlaceholderName(packageNameStr)) {
|
|
43
|
+
context.report({
|
|
44
|
+
node: nameProperty,
|
|
45
|
+
messageId: 'defaultPlaceholderName',
|
|
46
|
+
data: {
|
|
47
|
+
packageName: packageNameStr,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
36
52
|
if (!packageNameStr || !isValidPackageName(packageNameStr)) {
|
|
37
53
|
const suggestions = [];
|
|
38
54
|
// Generate package name suggestions if we have a valid string
|
|
@@ -61,6 +77,9 @@ export const PackageNameConventionRule = createRule({
|
|
|
61
77
|
};
|
|
62
78
|
},
|
|
63
79
|
});
|
|
80
|
+
function isDefaultPlaceholderName(name) {
|
|
81
|
+
return name.includes('<...>');
|
|
82
|
+
}
|
|
64
83
|
function isValidPackageName(name) {
|
|
65
84
|
const unscoped = /^n8n-nodes-.+$/;
|
|
66
85
|
const scoped = /^@.+\/n8n-nodes-.+$/;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-name-convention.js","sourceRoot":"","sources":["../../src/rules/package-name-convention.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC;IACnD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACL,WAAW,EAAE,mEAAmE;SAChF;QACD,QAAQ,EAAE;YACT,QAAQ,EAAE,+BAA+B;YACzC,kBAAkB,EACjB,gIAAgI;
|
|
1
|
+
{"version":3,"file":"package-name-convention.js","sourceRoot":"","sources":["../../src/rules/package-name-convention.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC;IACnD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACL,WAAW,EAAE,mEAAmE;SAChF;QACD,QAAQ,EAAE;YACT,QAAQ,EAAE,+BAA+B;YACzC,kBAAkB,EACjB,gIAAgI;YACjI,WAAW,EACV,yIAAyI;YAC1I,sBAAsB,EACrB,iHAAiH;SAClH;QACD,MAAM,EAAE,EAAE;QACV,cAAc,EAAE,IAAI;KACpB;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACb,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAA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M,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QAC3C,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,cAAc,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrD,CAAC;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACrC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const RequireNodeApiErrorRule: TSESLint.RuleModule<"useNodeApiError" | "useNodeApiErrorInsteadOfGeneric", [], unknown, TSESLint.RuleListener>;
|
|
2
3
|
//# sourceMappingURL=require-node-api-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-node-api-error.d.ts","sourceRoot":"","sources":["../../src/rules/require-node-api-error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"require-node-api-error.d.ts","sourceRoot":"","sources":["../../src/rules/require-node-api-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AA2BnF,eAAO,MAAM,uBAAuB,gHA+DlC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
1
|
+
import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils';
|
|
3
2
|
import { isFileType } from '../utils/index.js';
|
|
4
3
|
import { createRule } from '../utils/rule-creator.js';
|
|
5
4
|
const ALLOWED_ERROR_CLASSES = new Set(['NodeApiError', 'NodeOperationError']);
|
|
@@ -56,7 +55,7 @@ export const RequireNodeApiErrorRule = createRule({
|
|
|
56
55
|
if (argument.type === AST_NODE_TYPES.Identifier) {
|
|
57
56
|
const scope = context.sourceCode.getScope(node);
|
|
58
57
|
const ref = scope.references.find((r) => r.identifier === argument);
|
|
59
|
-
const isCatchParam = ref?.resolved?.defs.some((def) => def.type === DefinitionType.CatchClause) ?? false;
|
|
58
|
+
const isCatchParam = ref?.resolved?.defs.some((def) => def.type === TSESLint.Scope.DefinitionType.CatchClause) ?? false;
|
|
60
59
|
if (isCatchParam) {
|
|
61
60
|
context.report({ node, messageId: 'useNodeApiError' });
|
|
62
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-node-api-error.js","sourceRoot":"","sources":["../../src/rules/require-node-api-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"require-node-api-error.js","sourceRoot":"","sources":["../../src/rules/require-node-api-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAE9E,SAAS,kBAAkB,CAAC,QAA6B;IACxD,IAAI,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,aAAa,EAAE,CAAC;QACpD,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,EAAE,CAAC;YACxD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QAC7B,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAmB;IAC/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D,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBAChD,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC;oBACpE,MAAM,YAAY,GACjB,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CACvB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAC/D,IAAI,KAAK,CAAC;oBAEZ,IAAI,YAAY,EAAE,CAAC;wBAClB,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;oBACxD,CAAC;oBACD,OAAO;gBACR,CAAC;gBAED,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;gBAChD,IAAI,UAAU,KAAK,IAAI,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;oBACnE,OAAO,CAAC,MAAM,CAAC;wBACd,IAAI;wBACJ,SAAS,EAAE,iCAAiC;wBAC5C,IAAI,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE;qBAChC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TSESTree } from '@typescript-eslint/
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import { isNodeTypeClass, findClassProperty, findArrayLiteralProperty, extractCredentialNameFromArray, findPackageJson, readPackageJsonCredentials, isFileType, findSimilarStrings, createRule, } from '../utils/index.js';
|
|
3
3
|
export const ValidCredentialReferencesRule = createRule({
|
|
4
4
|
name: 'valid-credential-references',
|