mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
refactor: Clear unused ESLint directives from BE packages (no-changelog) (#6798)
This commit is contained in:
@@ -182,7 +182,7 @@ function chunk(value: unknown[], extraArgs: number[]) {
|
||||
const chunks: unknown[][] = [];
|
||||
for (let i = 0; i < value.length; i += chunkSize) {
|
||||
// I have no clue why eslint thinks 2 numbers could be anything but that but here we are
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
||||
|
||||
chunks.push(value.slice(i, i + chunkSize));
|
||||
}
|
||||
return chunks;
|
||||
@@ -275,7 +275,6 @@ function union(value: unknown[], extraArgs: unknown[][]): unknown[] {
|
||||
}
|
||||
const newArr: unknown[] = Array.from(value);
|
||||
for (const v of others) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
if (newArr.findIndex((w) => deepEqual(w, v, { strict: true })) === -1) {
|
||||
newArr.push(v);
|
||||
}
|
||||
@@ -313,7 +312,6 @@ function intersection(value: unknown[], extraArgs: unknown[][]): unknown[] {
|
||||
}
|
||||
}
|
||||
for (const v of others) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
if (value.findIndex((w) => deepEqual(w, v, { strict: true })) !== -1) {
|
||||
newArr.push(v);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ExpressionExtensionError } from './../ExpressionError';
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
||||
|
||||
import { DateTime } from 'luxon';
|
||||
import type {
|
||||
DateTimeUnit,
|
||||
|
||||
@@ -88,7 +88,6 @@ export const hasNativeMethod = (method: string): boolean => {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function parseWithEsprimaNext(source: string, options?: any): any {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
const ast = esprimaParse(source, {
|
||||
loc: true,
|
||||
locations: true,
|
||||
@@ -451,7 +450,6 @@ interface FoundFunction {
|
||||
function: Function;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function findExtendedFunction(input: unknown, functionName: string): FoundFunction | undefined {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
let foundFunction: Function | undefined;
|
||||
@@ -479,12 +477,7 @@ function findExtendedFunction(input: unknown, functionName: string): FoundFuncti
|
||||
const inputAny: any = input;
|
||||
// This is likely a builtin we're implementing for another type
|
||||
// (e.g. toLocaleString). We'll return that instead
|
||||
if (
|
||||
inputAny &&
|
||||
functionName &&
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
typeof inputAny[functionName] === 'function'
|
||||
) {
|
||||
if (inputAny && functionName && typeof inputAny[functionName] === 'function') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
return { type: 'native', function: inputAny[functionName] };
|
||||
}
|
||||
@@ -508,7 +501,6 @@ function findExtendedFunction(input: unknown, functionName: string): FoundFuncti
|
||||
* ```
|
||||
*/
|
||||
export function extend(input: unknown, functionName: string, args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
const foundFunction = findExtendedFunction(input, functionName);
|
||||
|
||||
// No type specific or generic function found. Check to see if
|
||||
@@ -522,7 +514,6 @@ export function extend(input: unknown, functionName: string, args: unknown[]) {
|
||||
}
|
||||
|
||||
if (haveFunction.length > 1) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const lastType = `"${haveFunction.pop()!.typeName}"`;
|
||||
const typeNames = `${haveFunction.map((v) => `"${v.typeName}"`).join(', ')}, and ${lastType}`;
|
||||
throw new ExpressionExtensionError(
|
||||
|
||||
@@ -64,7 +64,7 @@ export function compact(value: object): object {
|
||||
if (val !== null && val !== undefined && val !== 'nil' && val !== '') {
|
||||
if (typeof val === 'object') {
|
||||
if (Object.keys(val as object).length === 0) continue;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
||||
newObj[key] = compact(val);
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
// import { createHash } from 'crypto';
|
||||
import { titleCase } from 'title-case';
|
||||
import * as ExpressionError from '../ExpressionError';
|
||||
@@ -295,7 +294,6 @@ function toSentenceCase(value: string) {
|
||||
const charIndex = current.search(CHAR_TEST_REGEXP);
|
||||
current =
|
||||
current.slice(0, charIndex) +
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
current[charIndex]!.toLocaleUpperCase() +
|
||||
current.slice(charIndex + 1).toLocaleLowerCase();
|
||||
const puncIndex = current.search(PUNC_TEST_REGEXP);
|
||||
|
||||
Reference in New Issue
Block a user