chore: standardized code quality and formatting for tooling scripts
- Added `scripts/**/*.ts` to the linter and formatter inclusion list in `biome.json`. - Replaced manual array index searches with standard `indexOf` operations. - Cleaned up unused variables, obsolete helpers, and command-line flags. - Applied consistent formatting and code style across tooling scripts.
This commit is contained in:
@@ -10,20 +10,20 @@ Bun.plugin({
|
||||
name: "trace-loader",
|
||||
setup(build) {
|
||||
// Trace module resolution (doesn't interfere with loading)
|
||||
build.onResolve({ filter: /.*/ }, (args) => {
|
||||
build.onResolve({ filter: /.*/ }, args => {
|
||||
// Skip if already traced this path
|
||||
if (resolved.has(args.path)) {
|
||||
return undefined;
|
||||
}
|
||||
resolved.add(args.path);
|
||||
|
||||
|
||||
const elapsed = ((Bun.nanoseconds() - startTime) / 1e6).toFixed(1);
|
||||
// Only trace local/project files, not node_modules
|
||||
if (!args.path.includes("node_modules") && !args.path.startsWith("node:")) {
|
||||
const shortPath = args.path.replace(process.cwd(), ".");
|
||||
process.stderr.write(`[${elapsed}ms] resolve: ${shortPath}\n`);
|
||||
}
|
||||
|
||||
|
||||
// Return undefined to let Bun handle resolution normally
|
||||
return undefined;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user