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:
Michael Kret
2022-12-02 22:54:28 +02:00
committed by GitHub
parent 8101c05d6f
commit 61e26804ba
796 changed files with 3735 additions and 2847 deletions

View File

@@ -2044,7 +2044,7 @@ export class GoogleDrive implements INodeType {
query.push(`mimeType != 'application/vnd.google-apps.folder'`);
const res = await googleApiRequest.call(this, 'GET', '/drive/v3/files', undefined, {
q: query.join(' and '),
pageToken: paginationToken as string | undefined,
pageToken: paginationToken,
fields: 'nextPageToken,files(id,name,mimeType,webViewLink)',
orderBy: 'name_natural',
});
@@ -2069,7 +2069,7 @@ export class GoogleDrive implements INodeType {
query.push(`mimeType = 'application/vnd.google-apps.folder'`);
const res = await googleApiRequest.call(this, 'GET', '/drive/v3/files', undefined, {
q: query.join(' and '),
pageToken: paginationToken as string | undefined,
pageToken: paginationToken,
fields: 'nextPageToken,files(id,name,mimeType,webViewLink)',
orderBy: 'name_natural',
});
@@ -2089,7 +2089,7 @@ export class GoogleDrive implements INodeType {
): Promise<INodeListSearchResult> {
const res = await googleApiRequest.call(this, 'GET', '/drive/v3/drives', undefined, {
q: filter ? `name contains '${filter.replace("'", "\\'")}'` : undefined,
pageToken: paginationToken as string | undefined,
pageToken: paginationToken,
});
return {
results: res.drives.map((i: GoogleDriveDriveItem) => ({
@@ -2111,10 +2111,10 @@ export class GoogleDrive implements INodeType {
for (let i = 0; i < items.length; i++) {
try {
const options = this.getNodeParameter('options', i, {}) as IDataObject;
const options = this.getNodeParameter('options', i, {});
let queryFields = 'id, name';
if (options && options.fields) {
if (options?.fields) {
const fields = options.fields as string[];
if (fields.includes('*')) {
queryFields = '*';
@@ -2206,7 +2206,7 @@ export class GoogleDrive implements INodeType {
Object.assign(qs, options);
if (returnAll === true) {
if (returnAll) {
response = await googleApiRequestAllItems.call(
this,
'drives',
@@ -2303,7 +2303,7 @@ export class GoogleDrive implements INodeType {
const fileId = this.getNodeParameter('fileId', i, undefined, {
extractValue: true,
}) as string;
const options = this.getNodeParameter('options', i);
const downloadOptions = this.getNodeParameter('options', i);
const requestOptions = {
resolveWithFullResponse: true,
@@ -2376,8 +2376,8 @@ export class GoogleDrive implements INodeType {
mimeType = response.headers['content-type'];
}
if (options.fileName) {
fileName = options.fileName as string;
if (downloadOptions.fileName) {
fileName = downloadOptions.fileName as string;
}
const newItem: INodeExecutionData = {
@@ -2435,7 +2435,7 @@ export class GoogleDrive implements INodeType {
let queryString = '';
const useQueryString = this.getNodeParameter('useQueryString', i) as boolean;
if (useQueryString === true) {
if (useQueryString) {
// Use the user defined query string
queryString = this.getNodeParameter('queryString', i) as string;
} else {
@@ -2445,13 +2445,13 @@ export class GoogleDrive implements INodeType {
const queryFilterFields: string[] = [];
if (queryFilters.name) {
(queryFilters.name as IDataObject[]).forEach((nameFilter) => {
let operation = nameFilter.operation;
if (operation === 'is') {
operation = '=';
} else if (operation === 'isNot') {
operation = '!=';
let filterOperation = nameFilter.operation;
if (filterOperation === 'is') {
filterOperation = '=';
} else if (filterOperation === 'isNot') {
filterOperation = '!=';
}
queryFilterFields.push(`name ${operation} '${nameFilter.value}'`);
queryFilterFields.push(`name ${filterOperation} '${nameFilter.value}'`);
});
queryString += queryFilterFields.join(' or ');
@@ -2491,7 +2491,7 @@ export class GoogleDrive implements INodeType {
const response = await googleApiRequest.call(this, 'GET', `/drive/v3/files`, {}, qs);
const files = response!.files;
const files = response.files;
const version = this.getNode().typeVersion;
@@ -2514,7 +2514,7 @@ export class GoogleDrive implements INodeType {
let mimeType = 'text/plain';
let body;
let originalFilename: string | undefined;
if (this.getNodeParameter('binaryData', i) === true) {
if (this.getNodeParameter('binaryData', i)) {
// Is binary file to upload
const item = items[i];
@@ -2625,7 +2625,7 @@ export class GoogleDrive implements INodeType {
qs,
);
if (resolveData === true) {
if (resolveData) {
response = await googleApiRequest.call(
this,
'GET',
@@ -2648,7 +2648,7 @@ export class GoogleDrive implements INodeType {
const id = this.getNodeParameter('fileId', i, undefined, {
extractValue: true,
}) as string;
const updateFields = this.getNodeParameter('updateFields', i, {}) as IDataObject;
const updateFields = this.getNodeParameter('updateFields', i, {});
const qs: IDataObject = {
supportsAllDrives: true,
@@ -2751,7 +2751,7 @@ export class GoogleDrive implements INodeType {
const permissions = this.getNodeParameter('permissionsUi', i) as IDataObject;
const options = this.getNodeParameter('options', i);
const shareOption = this.getNodeParameter('options', i);
const body: IDataObject = {};
@@ -2763,7 +2763,7 @@ export class GoogleDrive implements INodeType {
Object.assign(body, permissions.permissionsValues);
}
Object.assign(qs, options);
Object.assign(qs, shareOption);
const response = await googleApiRequest.call(
this,