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:
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user