Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions build-tools/packages/build-cli/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = {
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
},
rules: {
// Catch unused variables in at lint time instead of compile time
"@typescript-eslint/no-unused-vars": "error",

// This rule is often triggered when using custom Flags, so disabling.
"object-shorthand": "off",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig"

// This should not be called due to processPackages being overridden instead.
protected override async processPackage<TPkg extends Package>(
pkg: TPkg,
kind: PackageKind,
_pkg: TPkg,
_kind: PackageKind,
): Promise<void> {
throw new Error("Method not implemented.");
}
Expand Down Expand Up @@ -227,7 +227,7 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig"
return errors;
}

for (const [pkg, data] of dataMap) {
for (const [, data] of dataMap) {
errors.push(...this.tagAsserts(collected, data));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export default class FilterCommand extends PackageCommand<typeof FilterCommand>
static readonly enableJsonFlag = true;
protected defaultSelection = "dir" as PackageSelectionDefault;

protected async processPackage(pkg: Package): Promise<void> {
protected async processPackage(_pkg: Package): Promise<void> {
// do nothing
}

protected async processPackages(packages: PackageWithKind[]): Promise<string[]> {
protected async processPackages(_packages: PackageWithKind[]): Promise<string[]> {
// do nothing
return [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export abstract class InitFailedStateHandler extends BaseStateHandler {
state: MachineState,
machine: Machine<unknown>,
testMode: boolean,
log: CommandLogger,
data: unknown,
_log: CommandLogger,
_data: unknown,
): Promise<boolean> {
switch (state) {
case "Init": {
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/src/library/branches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function getDefaultBumpTypeForBranch(
* @internal
*/
export function getReleaseSourceForReleaseGroup(
releaseGroupOrPackage: ReleaseGroup | ReleasePackage,
_releaseGroupOrPackage: ReleaseGroup | ReleasePackage,
): ReleaseSource {
// All packages and release groups use release branches.
return "releaseBranches";
Expand Down
1 change: 0 additions & 1 deletion build-tools/packages/build-cli/src/library/changesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import globby from "globby";
import matter from "gray-matter";
import issueParser from "issue-parser";
import { simpleGit } from "simple-git";
const { test: hasFrontMatter } = matter;

import type { ReleaseNotesSectionName } from "../config.js";
import { ReleasePackage } from "../releaseGroups.js";
Expand Down
1 change: 0 additions & 1 deletion build-tools/packages/build-cli/src/library/githubRest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ export async function getCommentBody(
pull_number: prNumber,
});

let commentBody: string | undefined;
// Check the comments to find the comment with the identifier.
for (const comment of comments) {
if (comment.body.startsWith(commentIdentifier)) {
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/src/library/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function removeSectionContent(options: { heading: string | RegExp }): (
tree: Root,
) => void {
return function (tree: Root) {
headingRange(tree, options.heading, (start, nodes, end, info) => {
headingRange(tree, options.heading, (start, _nodes, end, _info) => {
return [
start,
// No child nodes - effectively empties the section.
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outDir": "./lib",
"types": ["node"],
"noImplicitAny": true,
"noUnusedLocals": false,
"noUnusedLocals": false, // Checked in lint instead
"target": "ES2022",
"noUncheckedIndexedAccess": false,
"exactOptionalPropertyTypes": false,
Expand Down
3 changes: 3 additions & 0 deletions build-tools/packages/build-infrastructure/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = {
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
},
rules: {
// Catch unused variables in at lint time instead of compile time
"@typescript-eslint/no-unused-vars": "error",

// This package is exclusively used in a Node.js context
"import/no-nodejs-modules": "off",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ export class ListCommand extends Command {

// load the BuildProject
const repo = loadBuildProject(searchPath);
const _ = full ? await this.logFullReport(repo) : await this.logCompactReport(repo);
// eslint-disable-next-line unicorn/prefer-ternary
if (full) {
await this.logFullReport(repo);
} else {
await this.logCompactReport(repo);
}
}

private async logFullReport(repo: IBuildProject): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ import { testDataPath } from "./init.js";
/**
* A transformer function that does nothing.
*/
const testTransformer = (json: PackageJson): void => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why do this here instead of the underscore prefix.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't figure out why, but the lint rule gets tripped even when disabled in the config. I ended up just removing the placeholder args completely.

const testTransformer = (_json: PackageJson): void => {
// do nothing
return;
};

/**
* A transformer function that does nothing.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const testTransformerAsync = async (json: PackageJson): Promise<void> => {
// do nothing
return;
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-infrastructure/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"outDir": "./lib",
"types": ["node"],
"exactOptionalPropertyTypes": false,
"noUnusedLocals": false,
"noUnusedLocals": false, // Checked in lint instead
},
}
3 changes: 3 additions & 0 deletions build-tools/packages/build-tools/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ module.exports = {
"@typescript-eslint/no-unsafe-member-access": "off",

"@typescript-eslint/no-non-null-assertion": "error",

// Catch unused variables in at lint time instead of compile time
"@typescript-eslint/no-unused-vars": "error",

"@typescript-eslint/switch-exhaustiveness-check": "error",

// This package is exclusively used in a Node.js context
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-tools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"composite": true,
"noImplicitAny": false,
"noImplicitThis": true,
"noUnusedLocals": false,
"noUnusedLocals": false, // Checked in lint instead
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
Expand Down
Loading