Skip to content

Commit 214912d

Browse files
committed
fix(core): skip eslint custom hasher when hashing tasks during running commands (#28616)
This change speeds up Nx Cloud runs by not orchestrating cache hits for lint tasks. <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
1 parent aeacee8 commit 214912d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/eslint/src/executors/lint/hasher.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ export default async function run(
5050
hashes.push(res.details.nodes[d]);
5151
}
5252
}
53-
return {
53+
const hashResult = {
5454
value: hashArray([command, selfSource, ...hashes, tags]),
5555
details: {
5656
command,
5757
nodes: { [task.target.project]: selfSource, tags, ...nodes },
5858
},
5959
};
60+
hashResult['name'] = 'eslint-hasher';
61+
return hashResult;
6062
}
6163

6264
function allDeps(

packages/nx/src/hasher/hash-task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(
4141
const tasksToHash = tasksWithHashers
4242
.filter(({ task, customHasher }) => {
4343
// If a task has a custom hasher, it might depend on the outputs of other tasks
44-
if (customHasher) {
44+
if (customHasher && customHasher.name !== 'eslint-hasher') {
4545
return false;
4646
}
4747

0 commit comments

Comments
 (0)