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

prefer-number-properties: Add checkNaN option #2315

Merged
merged 16 commits into from May 7, 2024

Conversation

gurgunday
Copy link
Contributor

I think the NaN check should also be toggleable, because I use it like I use null (absence of an object), to represent an absence of a number; and since null is global, this setting lets me be more consistent

Thanks for maintaining this amazing plugin!

@gurgunday
Copy link
Contributor Author

CI error not related I believe

@sindresorhus
Copy link
Owner

// @Richienb

@Richienb Richienb mentioned this pull request Apr 9, 2024
4 tasks
@fisker
Copy link
Collaborator

fisker commented Apr 9, 2024

Should the option be checkNaN or checkNan ?

@Richienb
Copy link
Contributor

Richienb commented Apr 9, 2024

Could we maybe set it to false by default? (breaking)
I also think that NaN is better than Number.NaN.

@sindresorhus
Copy link
Owner

Could we maybe set it to false by default? (breaking)

👍

docs/rules/prefer-number-properties.md Outdated Show resolved Hide resolved
@gurgunday
Copy link
Contributor Author

Not sure why this is failing, will try to take a look

gurgunday and others added 2 commits April 10, 2024 16:21
Co-authored-by: Richie Bendall <richiebendall@gmail.com>
@gurgunday
Copy link
Contributor Author

Yeah, sorry y'all — when I turn it off by default, a bunch of tests are failing and even though I modify them to be like Infinity checks, there are errors

I do not have the time to look into it, so let's focus on adding this feature in this PR

See f544b63 to view my latest try

@gurgunday gurgunday requested a review from Richienb April 11, 2024 19:22
Copy link
Contributor

@Richienb Richienb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like some examples in the docs

@Richienb
Copy link
Contributor

I do not have the time to look into it, so let's focus on adding this feature in this PR

That's ok, we can change it in the next PR.

Added to the tracking issue

@gurgunday
Copy link
Contributor Author

I added one more, what else would you like to see?

@gurgunday gurgunday requested a review from Richienb April 12, 2024 08:36
docs/rules/prefer-number-properties.md Outdated Show resolved Hide resolved
@gurgunday
Copy link
Contributor Author

I can't request a review so just tagging 🙏

@sindresorhus

@sindresorhus sindresorhus changed the title prefer-number-properties, add checkNaN prefer-number-properties: Add checkNaN option Apr 19, 2024
@sindresorhus sindresorhus merged commit d30de50 into sindresorhus:main May 7, 2024
17 checks passed
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

5 participants