Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/eslint/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ function validateOptionCloneability(options) {
})
.sort();
const error = new TypeError(
`The ${uncloneableOptionKeys.length === 1 ? "option" : "options"} ${new Intl.ListFormat("en-US").format(uncloneableOptionKeys.map(key => `"${key}"`))} cannot be cloned. When concurrency is enabled, all options must be cloneable. Remove uncloneable options or use an options module.`,
`The ${uncloneableOptionKeys.length === 1 ? "option" : "options"} ${new Intl.ListFormat("en-US").format(uncloneableOptionKeys.map(key => `"${key}"`))} cannot be cloned. When concurrency is enabled, all options must be cloneable values (JSON values). Remove uncloneable options or use an options module.`,
);
error.code = "ESLINT_UNCLONEABLE_OPTIONS";
throw error;
Expand Down
12 changes: 6 additions & 6 deletions tests/lib/eslint/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ describe("ESLint", () => {
constructor: TypeError,
code: "ESLINT_UNCLONEABLE_OPTIONS",
message:
'The options "baseConfig", "fix", and "plugins" cannot be cloned. When concurrency is enabled, all options must be cloneable. Remove uncloneable options or use an options module.',
'The options "baseConfig", "fix", and "plugins" cannot be cloned. When concurrency is enabled, all options must be cloneable values (JSON values). Remove uncloneable options or use an options module.',
},
);
});
Expand All @@ -445,7 +445,7 @@ describe("ESLint", () => {
constructor: TypeError,
code: "ESLINT_UNCLONEABLE_OPTIONS",
message:
'The option "ruleFilter" cannot be cloned. When concurrency is enabled, all options must be cloneable. Remove uncloneable options or use an options module.',
'The option "ruleFilter" cannot be cloned. When concurrency is enabled, all options must be cloneable values (JSON values). Remove uncloneable options or use an options module.',
},
);
});
Expand Down Expand Up @@ -9778,13 +9778,13 @@ describe("ESLint", () => {
const optionsSrc = `
import assert from "node:assert";
import { isMainThread } from "node:worker_threads";

if (!isMainThread) {
if (process.env.ESLINT_TEST_ENV !== "test") {
assert.fail("Environment variable ESLINT_TEST_ENV is not set as expected in worker threads.");
}
}

export default {
concurrency: 2,
cwd: ${JSON.stringify(fixtureDir)},
Expand All @@ -9803,11 +9803,11 @@ describe("ESLint", () => {
it("should propagate environment variables from worker threads to the controlling thread", async () => {
const optionsSrc = `
import { isMainThread } from "node:worker_threads";

if (!isMainThread) {
process.env.ESLINT_TEST_ENV = "test";
}

export default {
concurrency: 2,
cwd: ${JSON.stringify(fixtureDir)},
Expand Down
Loading