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:
@@ -116,7 +116,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
||||
|
||||
responseData = responseData.map((element: { found: { id: string; name: string } }) => {
|
||||
if (element.found) {
|
||||
element.found.id = (element.found.name as string).split('/').pop() as string;
|
||||
element.found.id = element.found.name.split('/').pop() as string;
|
||||
}
|
||||
return element;
|
||||
});
|
||||
@@ -148,9 +148,9 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
||||
const document = { fields: {} };
|
||||
columnList.map((column) => {
|
||||
// @ts-ignore
|
||||
if (item['json'][column]) {
|
||||
if (item.json[column]) {
|
||||
// @ts-ignore
|
||||
document.fields[column] = jsonToDocument(item['json'][column]);
|
||||
document.fields[column] = jsonToDocument(item.json[column]);
|
||||
} else {
|
||||
// @ts-ignore
|
||||
document.fields[column] = jsonToDocument(null);
|
||||
@@ -209,9 +209,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
||||
});
|
||||
|
||||
if (simple) {
|
||||
responseData = responseData.map((element: IDataObject) =>
|
||||
fullDocumentToJson(element as IDataObject),
|
||||
);
|
||||
responseData = responseData.map((element: IDataObject) => fullDocumentToJson(element));
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
@@ -250,15 +248,15 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
||||
const collection = this.getNodeParameter('collection', i) as string;
|
||||
const updateKey = this.getNodeParameter('updateKey', i) as string;
|
||||
// @ts-ignore
|
||||
const documentId = item['json'][updateKey] as string;
|
||||
const documentId = item.json[updateKey] as string;
|
||||
const columns = this.getNodeParameter('columns', i) as string;
|
||||
const columnList = columns.split(',').map((column) => column.trim()) as string[];
|
||||
const columnList = columns.split(',').map((column) => column.trim());
|
||||
const document = {};
|
||||
columnList.map((column) => {
|
||||
// @ts-ignore
|
||||
if (item['json'].hasOwnProperty(column)) {
|
||||
if (item.json.hasOwnProperty(column)) {
|
||||
// @ts-ignore
|
||||
document[column] = jsonToDocument(item['json'][column]);
|
||||
document[column] = jsonToDocument(item.json[column]);
|
||||
} else {
|
||||
// @ts-ignore
|
||||
document[column] = jsonToDocument(null);
|
||||
@@ -286,7 +284,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
||||
);
|
||||
|
||||
for (let i = 0; i < writeResults.length; i++) {
|
||||
writeResults[i]['status'] = status[i];
|
||||
writeResults[i].status = status[i];
|
||||
Object.assign(writeResults[i], items[i].json);
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
@@ -345,9 +343,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
||||
responseData = responseData.map(
|
||||
(element: { document: { id: string; name: string } }) => {
|
||||
if (element.document) {
|
||||
element.document.id = (element.document.name as string)
|
||||
.split('/')
|
||||
.pop() as string;
|
||||
element.document.id = element.document.name.split('/').pop() as string;
|
||||
}
|
||||
return element;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user