Skip to content

Commit bfcba6a

Browse files
committed
fix: lint
1 parent 6f03df6 commit bfcba6a

18 files changed

Lines changed: 52 additions & 29 deletions

File tree

‎packages/isaacscript-cli/scripts/build.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async function copyITDEnumsFlag(packageRoot: string) {
118118

119119
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
120120
if (fileName === "DoorSlotFlag") {
121-
fileContents = `/* eslint-disable no-bitwise */\n\n${fileContents}`;
121+
fileContents = `/* eslint-disable complete/sort-objects */\n/* eslint-disable no-bitwise */\n\n${fileContents}`;
122122
fileContents = fileContents.replace(
123123
'import { DoorSlot } from "../DoorSlot";',
124124
'import { DoorSlot } from "./DoorSlot.js";',

‎packages/isaacscript-cli/src/commands/check/check.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { strictEqual } from "node:assert";
1+
import { strictEqual } from "node:assert/strict";
22
import test from "node:test";
33
import { getTruncatedText } from "./check.js";
44

‎packages/isaacscript-cli/src/commands/check/check.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable unicorn/no-unreadable-new-expression */
2+
13
import { Command } from "@commander-js/extra-typings";
24
import chalk from "chalk";
35
import { ReadonlySet, getEnumValues, trimPrefix } from "complete-common";
@@ -403,7 +405,7 @@ export function getTruncatedText(
403405
continue;
404406
}
405407

406-
if ((line.endsWith("]") || line.endsWith("],")) && isSkipping) {
408+
if (isSkipping && (line.endsWith("]") || line.endsWith("],"))) {
407409
isSkipping = false;
408410
continue;
409411
}

‎packages/isaacscript-cli/src/commands/copy/copy.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable unicorn/no-unreadable-new-expression */
2+
13
import { Command } from "@commander-js/extra-typings";
24
import type { PackageManager } from "complete-node";
35
import {

‎packages/isaacscript-cli/src/commands/init/createProject.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { initGitRepository } from "../../git.js";
4343
export async function createProject(
4444
projectName: string,
4545
projectPath: string,
46-
createNewDir: boolean,
46+
shouldCreateNewDir: boolean,
4747
modsDirectory: string | undefined,
4848
saveSlot: number | undefined,
4949
gitRemoteURL: string | undefined,
@@ -52,7 +52,7 @@ export async function createProject(
5252
dev: boolean,
5353
verbose: boolean,
5454
): Promise<void> {
55-
if (createNewDir) {
55+
if (shouldCreateNewDir) {
5656
await makeDirectory(projectPath);
5757
}
5858

‎packages/isaacscript-cli/src/commands/init/getProjectPath.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,39 @@ export async function getProjectPath(
2424
customDirectory: string | undefined,
2525
yes: boolean,
2626
forceName: boolean,
27-
): Promise<{ projectPath: string; createNewDir: boolean }> {
27+
): Promise<{ projectPath: string; shouldCreateNewDir: boolean }> {
2828
let projectName = name;
2929
let projectPath: string;
30-
let createNewDir: boolean;
30+
let shouldCreateNewDir: boolean;
3131
if (useCurrentDirectory) {
3232
// The "--use-current-directory" command-line flag was specified, so there is no need to prompt
3333
// the user.
3434
projectName = CURRENT_DIRECTORY_NAME;
3535
projectPath = CWD;
36-
createNewDir = false;
36+
shouldCreateNewDir = false;
3737
} else if (projectName !== undefined) {
3838
// The project name was specified on the command-line.
3939
const baseDirectory =
4040
customDirectory === undefined ? CWD : path.join(CWD, customDirectory);
4141
projectPath = path.join(baseDirectory, projectName);
42-
createNewDir = true;
42+
shouldCreateNewDir = true;
4343
} else if (yes) {
4444
// The "--yes" command-line flag was specified and the project name was not specified on the
4545
// command-line, so default to using the current directory.
4646
projectName = CURRENT_DIRECTORY_NAME;
4747
projectPath = CWD;
48-
createNewDir = false;
48+
shouldCreateNewDir = false;
4949
} else {
5050
// The project name was not specified on the command-line, so prompt the user for it.
51-
[projectName, projectPath, createNewDir] = await getNewProjectName();
51+
[projectName, projectPath, shouldCreateNewDir] = await getNewProjectName();
5252
}
5353

5454
validateProjectName(projectName, forceName);
55-
5655
console.log(`Using a project name of: ${chalk.green(projectName)}`);
56+
5757
return {
5858
projectPath,
59-
createNewDir,
59+
shouldCreateNewDir,
6060
};
6161
}
6262

‎packages/isaacscript-cli/src/commands/init/init.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable unicorn/no-unreadable-new-expression */
2+
13
import {
24
Command,
35
InvalidOptionArgumentError,
@@ -112,7 +114,7 @@ async function init(name: string | undefined, options: InitOptions) {
112114
const packageManager = await getPackageManagerUsedForNewProject(options);
113115

114116
// Prompt the end-user for some information (and validate it as we go).
115-
const { projectPath, createNewDir } = await getProjectPath(
117+
const { projectPath, shouldCreateNewDir } = await getProjectPath(
116118
name,
117119
useCurrentDirectory,
118120
customDirectory,
@@ -144,7 +146,7 @@ async function init(name: string | undefined, options: InitOptions) {
144146
await createProject(
145147
projectName,
146148
projectPath,
147-
createNewDir,
149+
shouldCreateNewDir,
148150
modsDirectory,
149151
saveSlot,
150152
gitRemoteURL,

‎packages/isaacscript-cli/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ function init() {
2525
`The ${SUBPROCESS_NAME} process did not get a valid second argument.`,
2626
);
2727

28+
// eslint-disable-next-line unicorn/no-top-level-assignment-in-function
2829
modSourcePath = firstArg;
30+
// eslint-disable-next-line unicorn/no-top-level-assignment-in-function
2931
modTargetPath = secondArg;
3032

3133
syncDirectory(modSourcePath, modTargetPath, {

‎packages/isaacscript-cli/src/commands/monitor/monitor.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable unicorn/no-unreadable-new-expression */
2+
13
import { Command } from "@commander-js/extra-typings";
24
import chalk from "chalk";
35
import {

‎packages/isaacscript-cli/src/commands/monitor/saveDatWriter/saveDatWriter.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ async function init() {
2323
`The ${SUBPROCESS_NAME} process did not get a valid first argument.`,
2424
);
2525

26+
// eslint-disable-next-line unicorn/no-top-level-assignment-in-function
2627
saveDatPath = firstArg;
28+
// eslint-disable-next-line unicorn/no-top-level-assignment-in-function
2729
saveDatFileName = path.basename(saveDatPath);
2830

2931
// Check to see if the data directory exists.

0 commit comments

Comments
 (0)