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

feat: no longer coerce numbers by default #157

Closed
wants to merge 1 commit into from
Closed

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Feb 2, 2019

This is a fairly big breaking change, but I think worthwhile. yargs and yargs-parser allow a user to opt in to numeric parsing on an option by option basis. Let's not magically convert strings to numbers by default, as this causes problems for phone #s, UUIDs, etc.

BREAKING CHANGE: folks must now opt in to parse-numbers, using configuration.

This feature feels too magical, and is leads to a variety of bug reports on yargs

BREAKING CHANGE: folks must now opt in to parse-numbers, using configuration.
@bcoe
Copy link
Member Author

bcoe commented Feb 2, 2019

open question to me, is it worth forcing a large number of folks in the community to update their usage of the yargs/yargs-parser API, to remove this feature that I think is too magical and causes a variety of bugs:

yargs/yargs#1099
yargs/yargs#963
yargs/yargs#550

alternatively, perhaps we look for leading 0s, +s, etc?

@bcoe
Copy link
Member Author

bcoe commented Feb 2, 2019

after seeing the number of test failures in yargs from this change (not to mention the number of tests that needed to be updated in yargs-parser) opted for this less drastic change:

#158

@bcoe bcoe closed this Feb 2, 2019
@bcoe bcoe deleted the parse-numbers-false branch February 2, 2019 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant