-
Notifications
You must be signed in to change notification settings - Fork 35
Added support for accepting jscodeshift
ignore options (e.g. --ignore-config
and --ignore-pattern
)
#89
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good thing to do, thanks for working on it!
src/options-support.js
Outdated
function extractJSCodeShiftOptions(options, codeShiftOptions = jsCodeShiftOptions) { | ||
let cliOptions = Object.assign({}, options); | ||
let jsCodeShiftOptions = []; | ||
codeShiftOptions.forEach(option => { | ||
if (Object.prototype.hasOwnProperty.call(cliOptions, option)) { | ||
let camelCaseOption = option.replace(/-([a-z])/g, (_, up) => up.toUpperCase()); | ||
jsCodeShiftOptions.push(`--${option}`, options[option]); | ||
delete cliOptions[option]; | ||
delete cliOptions[camelCaseOption]; | ||
} | ||
}); | ||
return { cliOptions, jsCodeShiftOptions }; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer to do this all in parseTransformArgs
, and ahve that essentially return { paths, options, transformerOptions }
or something like that.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this is my first open-source contribution that's why I was little hesitant towards altering the existing function and breaking the existing flow. Anyways, I have incorporated the changes in the parseTransformArgs itself.
Kindly have a look and let me know if this is okay.
I just landed a fairly big refactor from @simonihmig, would you mind rebasing on top of that work? I think it shouldn't dramatically affect what you have done here, but I just want to make sure CI is happy with the two changes together before landing. Also, we need to probably figure out how to do the parsing a bit better in general (instead of using |
I have rebased with the master and things look good. Will try to create a new PR to address the parsing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
jscodeshift
ignore options (e.g. --ignore-config
and --ignore-pattern
)
#88