Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build-tools/packages/build-cli/src/BasePackageCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export abstract class PackageCommand<
}

try {
// eslint-disable-next-line import-x/no-named-as-default-member -- async.mapLimit is the idiomatic usage
await async.mapLimit(packages, this.flags.concurrency, async (pkg: PackageWithKind) => {
started += 1;
updateStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const extractCoverageMetrics = (

/**
* Method that returns the coverage report for the build from the artifact.
* @param baselineZip - zipped coverage files for the build
* @param artifactZip - zipped coverage files for the build
* @param logger - The logger to log messages.
* @returns an map of coverage metrics for build containing packageName, lineCoverage and branchCoverage
*/
Expand Down
1 change: 1 addition & 0 deletions build-tools/packages/build-cli/src/commands/bump/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import { Flags } from "@oclif/core";
import chalk from "picocolors";
// eslint-disable-next-line import-x/no-named-as-default -- prompts default export is the intended API
import prompts from "prompts";
import stripAnsi from "strip-ansi";

Expand Down
4 changes: 2 additions & 2 deletions build-tools/packages/build-cli/src/commands/check/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { strict as assert } from "node:assert";
import * as fs from "node:fs";
import { EOL as newline } from "node:os";
import * as path from "node:path";
import path from "node:path";
Comment on lines 7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does path need this but fs kept as * as? (For some reason I thought * as was preferred. Why is it one way or the other?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically I think * as is more "correct" for ESM since you end up with an object that has all the named exports, while import path imports the default export. But node's default export is an object with all the named exports anyway, so it works with either pattern and this is fewer characters. But you're aso right about the fs import - it should follow the same style. I'll fix that in a future change though as the lint config actually gets enabled.

import process from "node:process";
import { Flags } from "@oclif/core";

Expand Down Expand Up @@ -313,7 +313,7 @@ export class CheckPolicy extends BaseCommand<typeof CheckPolicy> {
): Promise<void> {
const { exclusions, gitRoot, pathRegex } = commandContext;

const filePath = path.join(gitRoot, inputPath).trim().replace(/\\/g, "/");
const filePath = path.join(gitRoot, inputPath).trim().replaceAll("\\", "/");
assert(path.isAbsolute(filePath) === true);

if (!pathRegex.test(inputPath) || !fs.existsSync(filePath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig"
if (comments.length > 0) {
let originalErrorText = comments[0]
.getText()
.replace(/\/\*/g, "")
.replace(/\*\//g, "")
.replaceAll("/*", "")
.replaceAll("*/", "")
.trim();

// Replace leading+trailing double quotes and backticks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Flags, ux } from "@oclif/core";
import { PackageName } from "@rushstack/node-core-library";
import { humanId } from "human-id";
import chalk from "picocolors";
// eslint-disable-next-line import-x/no-named-as-default -- prompts default export is the intended API
import prompts from "prompts";

import { releaseGroupFlag } from "../../flags.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ function getNodeTypeData(node: Node, log: Logger, exportedName: string): TypeDat
tags: getTags(docs),
};

const escapedTypeName = exportedName.replace(/\./g, "_");
const trimmedKind = node.getKindName().replace(/Declaration/g, "");
const escapedTypeName = exportedName.replaceAll(".", "_");
const trimmedKind = node.getKindName().replaceAll("Declaration", "");

if (
// Covers instance type of the class (including generics of it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export default class FromTagCommand extends ReleaseReportBaseCommand<typeof From
const tag = input.startsWith(tagRefPrefix) ? input.slice(tagRefPrefix.length) : input;
const [rg, ver] = tag.split("_v");

// eslint-disable-next-line import-x/no-named-as-default-member -- semver.parse is the idiomatic usage
const version = semver.parse(ver);
if (version === null) {
throw new Error(`Invalid version parsed from tag: ${ver}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class UnreleasedReportCommand extends BaseCommand<typeof UnreleasedReport
* @param fullReleaseReport - The format of the "full" release report.
* @param version - The version string for the reports.
* @param outDir - The output directory for the reports.
* @param branchName - The branch name for the reports.
* @param log - The logger object for logging messages.
*/
async function generateReleaseReport(
Expand Down
5 changes: 3 additions & 2 deletions build-tools/packages/build-cli/src/commands/release/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export abstract class ReleaseReportBaseCommand<
*
* @param context - The {@link Context}.
* @param mode - The {@link ReleaseSelectionMode} to use to determine the release to report on.
* @param releaseGroup - If provided, the release data collected will be limited to only the pakages in this release
* @param releaseGroupOrPackage - If provided, the release data collected will be limited to only the packages in this release
* group and its direct Fluid dependencies.
* @param includeDependencies - If true, the release data will include the Fluid dependencies of the release group.
*/
Expand Down Expand Up @@ -205,7 +205,7 @@ export abstract class ReleaseReportBaseCommand<
/**
* Collects the releases of a given release group or package.
*
* @param context - The {@link Context}.
* @param repo - The {@link Repository}.
* @param releaseGroupOrPackage - The release group or package to collect release data for.
* @param repoVersion - The version of the release group or package in the repo.
* @param latestReleaseChooseMode - Controls which release is considered the latest.
Expand Down Expand Up @@ -734,5 +734,6 @@ async function writeReport(
const reportOutput = toReportKind(report, kind);

await writeJson(reportPath, reportOutput, { spaces: 2 });
// eslint-disable-next-line import-x/no-named-as-default-member -- sortJson.overwrite is the correct usage
sortJson.overwrite(reportPath);
}
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,4 @@ export interface WorkspaceDefinition {
// @public
export type WorkspaceName = Opaque<string, "WorkspaceName">;

// (No @packageDocumentation comment for this package)

```
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class BuildProject<P extends IPackage> implements IBuildProject<P> {
*/
public relativeToRepo(p: string): string {
// Replace \ in result with / in case OS is Windows.
return path.relative(this.root, p).replace(/\\/g, "/");
return path.relative(this.root, p).replaceAll("\\", "/");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-infrastructure/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* interdependencies between packages across a BuildProject. It then provides APIs to select, filter, and work with
* those package groups.
*
* @module default entrypoint
* @packageDocumentation
*/

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { strict as assert } from "node:assert";
import { unlink } from "node:fs/promises";
import * as os from "node:os";
import * as path from "node:path";
import path from "node:path";

import { expect } from "chai";
import { readJson, writeJson } from "fs-extra/esm";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { strict as assert } from "node:assert";
import * as path from "node:path";
import path from "node:path";

import { describe, it } from "mocha";

Expand Down
1 change: 0 additions & 1 deletion build-tools/packages/version-tools/src/commands/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ interface VersionInfo {
/**
* The root `version` command.
*/
// eslint-disable-next-line import-x/no-default-export
export default class VersionCommand extends Command {
static readonly description =
"Convert version strings between regular semver and the Fluid internal version scheme.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { getLatestReleaseFromList } from "../../schemes";
* standard tools (e.g. `npm show versions`) don't fully work in that scenario because the Fluid internal version scheme
* overloads the semver prerelease field.
*/
// eslint-disable-next-line import-x/no-default-export
export default class LatestCommand extends Command {
static readonly description =
"Find the latest version from a list of version strings, accounting for the Fluid internal version scheme.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export function bumpInternalVersion(
version: semver.SemVer | string,
bumpType: VersionBumpTypeExtended,
): semver.SemVer {
validateVersionScheme(version, true, undefined);
validateVersionScheme(version, true);
const [pubVer, intVer, prereleaseId] = fromInternalScheme(version, true, true);

const newIntVer =
Expand Down Expand Up @@ -376,7 +376,7 @@ export function getVersionRange(
version: semver.SemVer | string,
maxAutomaticBump: "minor" | "patch" | "~" | "^",
): string {
validateVersionScheme(version, true, undefined);
validateVersionScheme(version, true);

const lowVersion = version;
let highVersion: semver.SemVer;
Expand Down
Loading