chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -8,10 +8,7 @@ type IsMainModuleOptions = {
cwd?: string;
};
function normalizePathCandidate(
candidate: string | undefined,
cwd: string,
): string | undefined {
function normalizePathCandidate(candidate: string | undefined, cwd: string): string | undefined {
if (!candidate) return undefined;
const resolved = path.resolve(cwd, candidate);
@@ -31,22 +28,14 @@ export function isMainModule({
const normalizedCurrent = normalizePathCandidate(currentFile, cwd);
const normalizedArgv1 = normalizePathCandidate(argv[1], cwd);
if (
normalizedCurrent &&
normalizedArgv1 &&
normalizedCurrent === normalizedArgv1
) {
if (normalizedCurrent && normalizedArgv1 && normalizedCurrent === normalizedArgv1) {
return true;
}
// PM2 runs the script via an internal wrapper; `argv[1]` points at the wrapper.
// PM2 exposes the actual script path in `pm_exec_path`.
const normalizedPmExecPath = normalizePathCandidate(env.pm_exec_path, cwd);
if (
normalizedCurrent &&
normalizedPmExecPath &&
normalizedCurrent === normalizedPmExecPath
) {
if (normalizedCurrent && normalizedPmExecPath && normalizedCurrent === normalizedPmExecPath) {
return true;
}