refactor: Clear unused ESLint directives from BE packages (no-changelog) (#6798)
This commit is contained in:
@@ -25,7 +25,6 @@ export class Build extends Command {
|
||||
}),
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
async run() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const { flags } = this.parse(Build);
|
||||
@@ -47,10 +46,10 @@ export class Build extends Command {
|
||||
|
||||
this.log(`The nodes got built and saved into the following folder:\n${outputDirectory}`);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.log(`\nGOT ERROR: "${error.message}"`);
|
||||
this.log('====================================');
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @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
|
||||
this.log(error.stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ export class New extends Command {
|
||||
|
||||
static examples = ['$ n8n-node-dev new'];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
async run() {
|
||||
try {
|
||||
this.log('\nCreate new credentials/node');
|
||||
@@ -105,7 +104,7 @@ export class New extends Command {
|
||||
// node file
|
||||
const destinationFilePath = join(
|
||||
process.cwd(),
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`${changeCase.pascalCase(nodeName)}.${typeAnswers.type.toLowerCase()}.ts`,
|
||||
);
|
||||
|
||||
@@ -152,10 +151,10 @@ export class New extends Command {
|
||||
|
||||
this.log(`Node got created: ${destinationFilePath}`);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.log(`\nGOT ERROR: "${error.message}"`);
|
||||
this.log('====================================');
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.log(error.stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
"build": "tsc --noEmit",
|
||||
"build-node-dev": "tsc",
|
||||
"format": "prettier --write . --ignore-path ../../.prettierignore",
|
||||
"lint": "eslint --quiet .",
|
||||
"lintfix": "eslint . --fix",
|
||||
"lint": "eslint . --quiet --report-unused-disable-directives",
|
||||
"lintfix": "eslint . --fix --report-unused-disable-directives",
|
||||
"postpack": "rm -f oclif.manifest.json",
|
||||
"prepack": "echo \"Building project...\" && rm -rf dist && tsc -b && oclif-dev manifest",
|
||||
"watch": "tsc --watch"
|
||||
|
||||
@@ -15,19 +15,19 @@ import type { IBuildOptions } from './Interfaces';
|
||||
* directory:
|
||||
* https://github.com/Microsoft/TypeScript/issues/25430
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
|
||||
export async function createCustomTsconfig() {
|
||||
// Get path to simple tsconfig file which should be used for build
|
||||
const tsconfigPath = join(dirname(require.resolve('n8n-node-dev/src')), 'tsconfig-build.json');
|
||||
|
||||
// Read the tsconfig file
|
||||
const tsConfigString = await readFile(tsconfigPath, { encoding: 'utf8' });
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
|
||||
const tsConfig = jsonParse<{ include: string[] }>(tsConfigString);
|
||||
|
||||
// Set absolute include paths
|
||||
const newIncludeFiles = [];
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const includeFile of tsConfig.include) {
|
||||
newIncludeFiles.push(join(process.cwd(), includeFile));
|
||||
}
|
||||
@@ -101,7 +101,6 @@ export async function buildFiles({
|
||||
let errorMessage = error.message;
|
||||
|
||||
if (error.stdout !== undefined) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
errorMessage = `${errorMessage}\nGot following output:\n${error.stdout}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user