Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
erbesharat committed Dec 9, 2024
1 parent 27c8b6e commit 377a506
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/api/split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function split(payload: z.infer<typeof splitSchema>) {

// Get the dependency tree
const dependencyTreeManager = new DependencyTreeManager(
payload.entrypointPath
payload.entrypointPath,
);

const outputDir = payload.outputDir || path.dirname(payload.entrypointPath);
Expand All @@ -38,13 +38,13 @@ export async function split(payload: z.infer<typeof splitSchema>) {
const relativeFileNamePath = path.relative(targetDir, file.path);
const destinationPath = path.join(
annotationDirectory,
relativeFileNamePath
relativeFileNamePath,
);
fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
fs.writeFileSync(destinationPath, file.sourceCode, "utf8");
});
return files;
})
}),
);

// Store the processed annotations in the output directory
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SplitRunner from "../splitRunner/splitRunner";

export default async function splitCommandHandler(
entrypointPath: string, // Path to the entrypoint file
outputDir: string // Path to the output directory
outputDir: string, // Path to the output directory
) {
const groupMap: Record<number, Group> = {};

Expand All @@ -32,12 +32,12 @@ export default async function splitCommandHandler(
const relativeFileNamePath = path.relative(targetDir, file.path);
const destinationPath = path.join(
annotationDirectory,
relativeFileNamePath
relativeFileNamePath,
);
fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
fs.writeFileSync(destinationPath, file.sourceCode, "utf8");
});
})
}),
);

// Store the processed annotations in the output directory
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/src/splitRunner/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function removeAnnotationFromOtherGroups() {

const updatedSourceCode = languagePlugin.removeAnnotationFromOtherGroups(
file.sourceCode,
group
group,
);
return { ...file, sourceCode: updatedSourceCode };
});
Expand All @@ -51,7 +51,7 @@ function removeInvalidImportsAndUsages(exportMap: Map<string, DepExport[]>) {
const updatedSourceCode = languagePlugin.cleanupInvalidImports(
file.path,
file.sourceCode,
exportMap
exportMap,
);

return { ...file, sourceCode: updatedSourceCode };
Expand All @@ -64,7 +64,7 @@ function removeUnusedImports() {

const updatedSourceCode = languagePlugin.cleanupUnusedImports(
file.path,
file.sourceCode
file.sourceCode,
);

return { ...file, sourceCode: updatedSourceCode };
Expand Down Expand Up @@ -135,7 +135,7 @@ function removeErrors() {

const query = new Parser.Query(
languagePlugin.parser.getLanguage(),
"(ERROR) @error"
"(ERROR) @error",
);
const errorCaptures = query.captures(tree.rootNode);
errorCaptures.forEach((capture) => {
Expand All @@ -147,7 +147,7 @@ function removeErrors() {

const updatedSourceCode = removeIndexesFromSourceCode(
file.sourceCode,
indexesToRemove
indexesToRemove,
);

return { ...file, sourceCode: updatedSourceCode };
Expand Down

0 comments on commit 377a506

Please sign in to comment.