Skip to content

Commit

Permalink
Fix issue jest-community#58
Browse files Browse the repository at this point in the history
  • Loading branch information
rekki.katou committed Aug 15, 2023
1 parent 251a6e3 commit c7df9bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/runner/runESLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ const getComputedFixValue = ({ fix, quiet, fixDryRun }) => {
return undefined;
};

const removeUndefinedFromObject = object => {
return Object.keys(object).forEach(v => {
if (object[v] === undefined) {
// eslint-disable-next-line no-param-reassign
delete object[v];
}
});
};

const getESLintConstructor = async () => {
if (await shouldUseFlatConfig()) {
return FlatESLint;
Expand Down Expand Up @@ -162,7 +171,7 @@ const getCachedValues = async (config, extraOptions) => {
const cliOptions = {
...baseCliOptions,
fix: getComputedFixValue(baseCliOptions),
...extraOptions,
...removeUndefinedFromObject(extraOptions),
};

const ESLintConstructor = await getESLintConstructor();
Expand Down

0 comments on commit c7df9bb

Please sign in to comment.