Skip to content

Commit 3024efc

Browse files
committed
refactor: path.join --> path.resolve
1 parent fdc46c3 commit 3024efc

13 files changed

Lines changed: 16 additions & 16 deletions

File tree

packages/docs/scripts/build.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ await buildScript(async (packageRoot) => {
2323
);
2424
rm(...generatedDocPaths);
2525

26-
const repoRoot = path.join(packageRoot, "..", "..");
26+
const repoRoot = path.resolve(packageRoot, "..", "..");
2727

2828
await Promise.all([makeITDDocs(repoRoot), makeISCDocs(repoRoot)]);
2929

packages/docs/scripts/deploy.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const DOCS_REPO_NAME = "isaacscript.github.io";
1818
const GITHUB_PAGES_URL = `https://${DOCS_REPO_NAME}/isaacscript-common/core/constants/index.html`;
1919
const SECONDS_TO_SLEEP = 10;
2020

21-
const PACKAGE_ROOT = path.join(import.meta.dirname, "..");
21+
const PACKAGE_ROOT = path.resolve(import.meta.dirname, "..");
2222
const BUILD_DIRECTORY_PATH = path.join(PACKAGE_ROOT, "build");
23-
const REPO_ROOT = path.join(PACKAGE_ROOT, "..", "..");
23+
const REPO_ROOT = path.resolve(PACKAGE_ROOT, "..", "..");
2424
const DOCS_REPO = path.join(REPO_ROOT, DOCS_REPO_NAME);
2525
const DOCS_REPO_GIT = path.join(DOCS_REPO, ".git");
2626
const DOCS_REPO_GIT_BACKUP = `/tmp/${DOCS_REPO_NAME}.git`;

packages/docs/scripts/fixIsaacScriptCommon.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import path from "node:path";
5858

5959
const DEBUG = false as boolean;
6060
const PACKAGE_NAME = "isaacscript-common";
61-
const PACKAGE_ROOT = path.join(import.meta.dirname, "..");
61+
const PACKAGE_ROOT = path.resolve(import.meta.dirname, "..");
6262
const MARKDOWN_DOCS_DIR = path.join(PACKAGE_ROOT, "docs");
6363
const PACKAGE_DOCS_DIR = path.join(MARKDOWN_DOCS_DIR, PACKAGE_NAME);
6464
const MODULES_DIR = path.join(PACKAGE_DOCS_DIR, "modules");

packages/docs/scripts/fixIsaacTypeScriptDefinitions.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import fs from "node:fs";
1717
import path from "node:path";
1818

1919
const PACKAGE_NAME = "isaac-typescript-definitions";
20-
const PACKAGE_ROOT = path.join(import.meta.dirname, "..");
20+
const PACKAGE_ROOT = path.resolve(import.meta.dirname, "..");
2121
const MARKDOWN_DOCS_DIR = path.join(PACKAGE_ROOT, "docs");
2222
const PACKAGE_DOCS_DIR = path.join(MARKDOWN_DOCS_DIR, PACKAGE_NAME);
2323
const MODULES_DIR = path.join(PACKAGE_DOCS_DIR, "modules");

packages/eslint-plugin-isaacscript/scripts/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ if (pluginName === undefined || pluginName === "") {
1010
}
1111

1212
export const PLUGIN_NAME = pluginName;
13-
export const PACKAGE_ROOT = path.join(import.meta.dirname, "..");
14-
export const REPO_ROOT = path.join(PACKAGE_ROOT, "..", "..");
13+
export const PACKAGE_ROOT = path.resolve(import.meta.dirname, "..");
14+
export const REPO_ROOT = path.resolve(PACKAGE_ROOT, "..", "..");

packages/eslint-plugin-isaacscript/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default plugin;
2626
* We parse the package JSON manually since importing JSON files directly in Node is experimental.
2727
*/
2828
function getPackageJSON(): Record<string, unknown> {
29-
const packageRoot = path.join(import.meta.dirname, "..");
29+
const packageRoot = path.resolve(import.meta.dirname, "..");
3030
const packageJSONPath = path.join(packageRoot, "package.json");
3131
try {
3232
const packageJSONString = fs.readFileSync(packageJSONPath, "utf8");

packages/isaacscript-cli/scripts/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function copyIsaacScriptCommonFiles(packageRoot: string) {
4747

4848
function copyITDEnums(packageRoot: string) {
4949
const sourcePackage = "isaac-typescript-definitions";
50-
const sourceDirectoryPath = path.join(
50+
const sourceDirectoryPath = path.resolve(
5151
packageRoot,
5252
"..",
5353
sourcePackage,

packages/isaacscript-cli/scripts/lint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import chalk from "chalk";
22
import { $, $s, diff, echo, exit, lintScript, readFile } from "complete-node";
33
import path from "node:path";
44

5-
const REPO_ROOT = path.join(import.meta.dirname, "..");
5+
const PACKAGE_ROOT = path.resolve(import.meta.dirname, "..");
66
const LOCAL_GITIGNORE_PATH = path.join(
7-
REPO_ROOT,
7+
PACKAGE_ROOT,
88
"file-templates",
99
"dynamic",
1010
"Node.gitignore",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function checkTemplateDirectory(
146146
let projectFilePath = path.join(CWD, relativeTemplateFilePath);
147147
switch (templateFileName) {
148148
case "_cspell.config.jsonc": {
149-
projectFilePath = path.join(
149+
projectFilePath = path.resolve(
150150
projectFilePath,
151151
"..",
152152
"cspell.config.jsonc",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function spawnSaveDatWriter(config: ValidatedConfig): void {
1717
SUBPROCESS_NAME,
1818
SUBPROCESS_NAME,
1919
);
20-
const modsDataPath = path.join(config.modsDirectory, "..", "data");
20+
const modsDataPath = path.resolve(config.modsDirectory, "..", "data");
2121
const watcherModDataPath = path.join(modsDataPath, WATCHER_MOD_NAME);
2222
const saveDatFileName = `save${config.saveSlot}.dat`;
2323
const saveDatPath = path.join(watcherModDataPath, saveDatFileName);

0 commit comments

Comments
 (0)