Skip to content

Commit

Permalink
Fix lint errors from unicorn/prefer-spread
Browse files Browse the repository at this point in the history
  • Loading branch information
codykaup committed Sep 17, 2024
1 parent f653815 commit 3fd4882
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion node-src/git/getParentCommits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,6 @@ export async function getParentCommits(
// For any pair A,B of builds, there is no point in using B if it is an ancestor of A.
const descendentCommits = await maximallyDescendentCommits({ log }, commitsWithBuilds);

const ancestorCommits = extraParentCommits.concat(descendentCommits);
const ancestorCommits = [...extraParentCommits, ...descendentCommits];
return ancestorCommits;
}
7 changes: 4 additions & 3 deletions node-src/lib/getDependentStoryFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@ export async function getDependentStoryFiles(
// If we didn't find any node_modules in the stats file, it's probably incomplete and we can't
// trace changed dependencies, so we bail just in case.
ctx.turboSnap.bailReason = {
changedPackageFiles: ctx.git.changedFiles
.filter((file) => isPackageManifestFile(file))
.concat(changedPackageLockFiles),
changedPackageFiles: [
...ctx.git.changedFiles.filter((file) => isPackageManifestFile(file)),
...changedPackageLockFiles,
],
};
}

Expand Down
2 changes: 1 addition & 1 deletion node-src/tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ export const runPatchBuild = [prepareWorkspace, ...runUploadBuild, restoreWorksp
export default function index(options: Context['options']): Listr.ListrTask<Context>[] {
const tasks = options.patchHeadRef && options.patchBaseRef ? runUploadBuild : runUploadBuild;

return options.junitReport ? tasks.concat(report) : tasks;
return options.junitReport ? [...tasks, report] : tasks;
}
28 changes: 14 additions & 14 deletions node-src/ui/messages/info/tracedAffectedFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ export default (
const seen = new Set();
const traces = [...ctx.turboSnap.tracedPaths].map((p) => {
const parts = p.split('\n');
return parts
.reduce((acc, part, index) => {
if (index === 0) return chalk`— ${printPath(part)} {cyan [changed]}${printModules(part)}`;
const indent = ' '.repeat(index);
let note = '';
if (index === parts.length - 1) {
if (seen.has(part)) note = chalk` {yellow [duplicate]}`;
else seen.add(part);
}
return chalk`${
expanded ? `File Path: ${part}\n\nBase Directory: ${basedir}\n\n` : ''
}${acc}\n${indent}${printPath(part)}${note}${printModules(part, indent)}`;
}, '')
.concat(chalk`\n${' '.repeat(parts.length)}∟ {cyan [story index]}`);
const traceParts = parts.reduce((acc, part, index) => {
if (index === 0) return chalk`— ${printPath(part)} {cyan [changed]}${printModules(part)}`;
const indent = ' '.repeat(index);
let note = '';
if (index === parts.length - 1) {
if (seen.has(part)) note = chalk` {yellow [duplicate]}`;
else seen.add(part);
}
return chalk`${
expanded ? `File Path: ${part}\n\nBase Directory: ${basedir}\n\n` : ''
}${acc}\n${indent}${printPath(part)}${note}${printModules(part, indent)}`;
}, '');

return traceParts + chalk`\n${' '.repeat(parts.length)}∟ {cyan [story index]}`;
});

const note = chalk`\n\nSet {bold ${flag}} to {bold 'expanded'} to reveal underlying modules.`;
Expand Down

0 comments on commit 3fd4882

Please sign in to comment.