mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Remove linting exceptions in nodes-base (#4794)
* ⚡ enabled array-type * ⚡ await-thenable on * ⚡ ban-types on * ⚡ default-param-last on * ⚡ dot-notation on * ⚡ member-delimiter-style on * ⚡ no-duplicate-imports on * ⚡ no-empty-interface on * ⚡ no-floating-promises on * ⚡ no-for-in-array on * ⚡ no-invalid-void-type on * ⚡ no-loop-func on * ⚡ no-shadow on * ⚡ ban-ts-comment re enabled * ⚡ @typescript-eslint/lines-between-class-members on * address my own comment * @typescript-eslint/return-await on * @typescript-eslint/promise-function-async on * @typescript-eslint/no-unnecessary-boolean-literal-compare on * @typescript-eslint/no-unnecessary-type-assertion on * prefer-const on * @typescript-eslint/prefer-optional-chain on Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -43,7 +43,7 @@ export async function githubApiRequest(
|
||||
const credentials = await this.getCredentials('githubApi');
|
||||
credentialType = 'githubApi';
|
||||
|
||||
const baseUrl = credentials!.server || 'https://api.github.com';
|
||||
const baseUrl = credentials.server || 'https://api.github.com';
|
||||
options.uri = `${baseUrl}${endpoint}`;
|
||||
} else {
|
||||
const credentials = await this.getCredentials('githubOAuth2Api');
|
||||
@@ -105,6 +105,6 @@ export async function githubApiRequestAllItems(
|
||||
});
|
||||
query.page++;
|
||||
returnData.push.apply(returnData, responseData.body);
|
||||
} while (responseData.headers.link && responseData.headers.link.includes('next'));
|
||||
} while (responseData.headers.link?.includes('next'));
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@@ -1727,7 +1727,7 @@ export class Github implements INodeType {
|
||||
|
||||
body.message = this.getNodeParameter('commitMessage', i) as string;
|
||||
|
||||
if (this.getNodeParameter('binaryData', i) === true) {
|
||||
if (this.getNodeParameter('binaryData', i)) {
|
||||
// Is binary file to upload
|
||||
const item = items[i];
|
||||
|
||||
@@ -1829,8 +1829,8 @@ export class Github implements INodeType {
|
||||
|
||||
const assignees = this.getNodeParameter('assignees', i) as IDataObject[];
|
||||
|
||||
body.labels = labels.map((data) => data['label']);
|
||||
body.assignees = assignees.map((data) => data['assignee']);
|
||||
body.labels = labels.map((data) => data.label);
|
||||
body.assignees = assignees.map((data) => data.assignee);
|
||||
|
||||
endpoint = `/repos/${owner}/${repository}/issues`;
|
||||
} else if (operation === 'createComment') {
|
||||
@@ -1856,10 +1856,10 @@ export class Github implements INodeType {
|
||||
body = this.getNodeParameter('editFields', i, {}) as IDataObject;
|
||||
|
||||
if (body.labels !== undefined) {
|
||||
body.labels = (body.labels as IDataObject[]).map((data) => data['label']);
|
||||
body.labels = (body.labels as IDataObject[]).map((data) => data.label);
|
||||
}
|
||||
if (body.assignees !== undefined) {
|
||||
body.assignees = (body.assignees as IDataObject[]).map((data) => data['assignee']);
|
||||
body.assignees = (body.assignees as IDataObject[]).map((data) => data.assignee);
|
||||
}
|
||||
|
||||
endpoint = `/repos/${owner}/${repository}/issues/${issueNumber}`;
|
||||
@@ -1894,7 +1894,7 @@ export class Github implements INodeType {
|
||||
|
||||
requestMethod = 'POST';
|
||||
|
||||
body = this.getNodeParameter('additionalFields', i, {}) as IDataObject;
|
||||
body = this.getNodeParameter('additionalFields', i, {});
|
||||
|
||||
body.tag_name = this.getNodeParameter('releaseTag', i) as string;
|
||||
|
||||
@@ -1933,7 +1933,7 @@ export class Github implements INodeType {
|
||||
|
||||
returnAll = this.getNodeParameter('returnAll', 0);
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
qs.per_page = this.getNodeParameter('limit', 0);
|
||||
}
|
||||
}
|
||||
@@ -1946,7 +1946,7 @@ export class Github implements INodeType {
|
||||
|
||||
const releaseId = this.getNodeParameter('release_id', i) as string;
|
||||
|
||||
body = this.getNodeParameter('additionalFields', i, {}) as IDataObject;
|
||||
body = this.getNodeParameter('additionalFields', i, {});
|
||||
|
||||
endpoint = `/repos/${owner}/${repository}/releases/${releaseId}`;
|
||||
}
|
||||
@@ -1996,7 +1996,7 @@ export class Github implements INodeType {
|
||||
|
||||
returnAll = this.getNodeParameter('returnAll', 0);
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
qs.per_page = this.getNodeParameter('limit', 0);
|
||||
}
|
||||
}
|
||||
@@ -2022,7 +2022,7 @@ export class Github implements INodeType {
|
||||
|
||||
const pullRequestNumber = this.getNodeParameter('pullRequestNumber', i) as string;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
qs.per_page = this.getNodeParameter('limit', 0);
|
||||
}
|
||||
|
||||
@@ -2068,7 +2068,7 @@ export class Github implements INodeType {
|
||||
|
||||
returnAll = this.getNodeParameter('returnAll', 0);
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
qs.per_page = this.getNodeParameter('limit', 0);
|
||||
}
|
||||
} else if (operation === 'invite') {
|
||||
@@ -2092,7 +2092,7 @@ export class Github implements INodeType {
|
||||
endpoint = `/orgs/${owner}/repos`;
|
||||
returnAll = this.getNodeParameter('returnAll', 0);
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
qs.per_page = this.getNodeParameter('limit', 0);
|
||||
}
|
||||
}
|
||||
@@ -2103,7 +2103,7 @@ export class Github implements INodeType {
|
||||
}
|
||||
|
||||
const asBinaryProperty = this.getNodeParameter('asBinaryProperty', i, false) as boolean;
|
||||
if (returnAll === true) {
|
||||
if (returnAll) {
|
||||
responseData = await githubApiRequestAllItems.call(
|
||||
this,
|
||||
requestMethod,
|
||||
@@ -2116,7 +2116,7 @@ export class Github implements INodeType {
|
||||
}
|
||||
|
||||
if (fullOperation === 'file:get') {
|
||||
if (asBinaryProperty === true) {
|
||||
if (asBinaryProperty) {
|
||||
if (Array.isArray(responseData) && responseData.length > 1) {
|
||||
throw new NodeOperationError(this.getNode(), 'File Path is a folder, not a file.', {
|
||||
itemIndex: i,
|
||||
|
||||
@@ -419,7 +419,7 @@ export class GithubTrigger implements INodeType {
|
||||
responseData = await githubApiRequest.call(this, 'GET', endpoint, body);
|
||||
|
||||
for (const webhook of responseData as IDataObject[]) {
|
||||
if ((webhook!.config! as IDataObject).url! === webhookUrl) {
|
||||
if ((webhook.config! as IDataObject).url! === webhookUrl) {
|
||||
// Webhook got found
|
||||
if (JSON.stringify(webhook.events) === JSON.stringify(events)) {
|
||||
// Webhook with same events exists already so no need to
|
||||
|
||||
Reference in New Issue
Block a user