Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #58 cliOptions.fix is ignored #200

Merged
merged 6 commits into from
Aug 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
ljharb marked this conversation as resolved.
Show resolved Hide resolved
delete object[v];
}
});
};
hassoubeat marked this conversation as resolved.
Show resolved Hide resolved

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