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
Support numeric separators #13568
Comments
I believe there's nothing more that should be updated in ESLint core and ESLint core rules, aside from those 2 items listed above. It would be nice to also add some tests for |
It needs to be updated, there are some places where it is using |
I can work on |
We usually prepare one big PR that covers all new features that are going to be supported by the next I guess it would be easier to review and approve separate PRs, e.g., one per new language feature (like numeric separators), though they still can't be merged until the new On the other hand, the downside of separate PRs is that we should take care to merge all of them for the same In this particular case, we have three new features - numeric separator, logical assignment, and two new globals which require @eslint/eslint-team thoughts about making three separate PRs? |
Thanks, @mdjermanovic for explaining, I missed to notice that even previous PRs were single PRs. My bad! I would prefer the approach that would help the reviewers and fewer merge conflicts yeah for numeric separators I don't think there would be any conflicting change (at least for the rules ). Maybe one more way can be to create a branch as |
I prefer smaller PRs, personally :) As long as folks aren't touching the same code, we should be able to release Espree and then bump the version in individual PRs. When they're all ready and approved, we can merge them in, rebasing the latter ones on the first. |
Personally I prefer separate PR, cause it's easy to review and avoid conflicts |
I also prefer smaller PRs. Larger ones make conflicts more likely and so can be more difficult to get it merged. I’d actually prefer merging Espree changes first and then having a separate PR for each rule change. |
Seems there's an agreement to split PRs. I'm working on a PR for the rest of the changes related to numeric separators. |
This adds tests for numeric literal object keys that aren't digit-only decimal integer literals, including ES6 binary and octal literals, ES2020 bigint literals, and ES2021 numeric separators. The valid tests have similar-looking literals that are distinct keys, and the invalid tests have differently-formatted literals that result in duplicate keys.
… (#13574) * Update: support numeric-separator in no-loss-of-precision (refs #13568) * Chore: changed the function jsdocs description * Chore: removed extra getRaw calls * Chore: update lib/rules/no-loss-of-precision.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
This adds tests for numeric literal object keys that aren't digit-only decimal integer literals, including ES6 binary and octal literals, ES2020 bigint literals, and ES2021 numeric separators. The valid tests have similar-looking literals that are distinct keys, and the invalid tests have differently-formatted literals that result in duplicate keys.
This is all merged and released, so closing. |
Anyone looking for the rule enforce or prefer numeric separators: I started a simple version here https://github.com/naoisegolden/eslint-plugin-prefer-numeric-separators, feel free to contribute. |
Also you can try this rule: unicorn/numeric-separators-style |
Numeric separators proposal is now in Stage 4.
https://github.com/tc39/proposal-numeric-separator
ESLint's default parser will support this syntax under
ecmaVersion: 2021
no-loss-of-precision
Update: support numeric-separator in no-loss-of-precision (refs #13568) #13574astUtils.isDecimalInteger
andastUtils.isDecimalIntegerNumericToken
Update: support numeric separators (refs #13568) #13581The text was updated successfully, but these errors were encountered: