Fix lint errors: add eslint-disable for __dirname, fix no-use-before-define

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-22 14:32:02 +01:00
parent 6fa63d411f
commit 553e727d5f
13 changed files with 26 additions and 16 deletions
+1
View File
@@ -19,6 +19,7 @@ import semver from 'semver';
import { findOwnPaths } from '@backstage/cli-common';
import { Lockfile } from './versioning';
/* eslint-disable-next-line no-restricted-syntax */
const ownPaths = findOwnPaths(__dirname);
/* eslint-disable @backstage/no-relative-monorepo-imports */
@@ -28,7 +28,7 @@ import {
HostSharedDependencies,
RuntimeSharedDependenciesGlobal,
} from '@backstage/module-federation-common';
import { dirname, join as joinPath, resolve as resolvePath } from 'path';
import { dirname, join as joinPath, resolve as resolvePath } from 'node:path';
import fs from 'fs-extra';
import chokidar from 'chokidar';
import PQueue from 'p-queue';
@@ -49,6 +49,7 @@ export function resolveBundlingPaths(options: BundlingPathsOptions) {
} else {
targetHtml = resolvePath(targetDir, `${entry}.html`);
if (!fs.pathExistsSync(targetHtml)) {
/* eslint-disable-next-line no-restricted-syntax */
targetHtml = findOwnPaths(__dirname).resolve(
'templates/serve_index.html',
);
@@ -55,6 +55,7 @@ function hasBackstageField(packageName: string, targetPath: string): boolean {
export default async (options: InfoOptions) => {
await new Promise(async () => {
const yarnVersion = await runOutput(['yarn', '--version']);
/* eslint-disable-next-line no-restricted-syntax */
const isLocal = fs.existsSync(findOwnPaths(__dirname).resolve('./src'));
const backstageFile = targetPaths.resolveRoot('backstage.json');
@@ -38,6 +38,7 @@ export default async (_opts: OptionValues, cmd: Command) => {
// Only include our config if caller isn't passing their own config
if (!includesAnyOf(args, '-c', '--config')) {
/* eslint-disable-next-line no-restricted-syntax */
args.push('--config', findOwnPaths(__dirname).resolve('config/jest.js'));
}
@@ -167,6 +167,7 @@ export async function command(opts: OptionValues, cmd: Command): Promise<void> {
// Only include our config if caller isn't passing their own config
if (!hasFlags('-c', '--config')) {
/* eslint-disable-next-line no-restricted-syntax */
args.push('--config', findOwnPaths(__dirname).resolve('config/jest.js'));
}