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

Rule proposal: the never option for the numeric-separators-style #2493

Closed
vanyauhalin opened this issue Nov 12, 2024 · 1 comment
Closed

Comments

@vanyauhalin
Copy link

Description

I would appreciate a flag or option to disallow the use of a separator for numbers.

Fail

const n = 10_000

Pass

const n = 10000

Proposed rule name

numeric-separators-style

Additional Info

To avoid adding a new flag it could be achieved using a negative (exact -1) value:

{
  "unicorn/number-literal-case": ["error", -1],
}
{
  "unicorn/number-literal-case": {
    hexadecimal: -1,
    binary: -1,
    octal: -1,
    number: -1,
  },
}
{
  "unicorn/number-literal-case": {
    hexadecimal: {minimumDigits: -1},
    binary: {minimumDigits: -1},
    octal: {minimumDigits: -1},
    number: {minimumDigits: -1},
  },
}
@fregante fregante marked this as a duplicate of #868 Nov 12, 2024
@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
@fregante fregante marked this as not a duplicate of #868 Nov 12, 2024
@fregante fregante reopened this Nov 12, 2024
@vanyauhalin
Copy link
Author

I am going to close this issue. I see that this idea is probably against the views of the maintainers of this rule set. That is fine; I do not want to force it. Moreover, I have found the es-x/no-numeric-separators rule that suits me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants