Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
fix(eslint-plugin): [no-misused-spread] correct and elaborate string spread report message#10751
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
fix(eslint-plugin): [no-misused-spread] correct and elaborate string spread report message#10751
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…spread report message
Thanks for the PR,@JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedJan 31, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
nx-cloudbot commentedJan 31, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
View yourCI Pipeline Execution ↗ for commit1af6d6f.
☁️Nx Cloud last updated this comment at |
'- .split("") produces UTF-16 code units, which breaks rich characters in many languages', | ||
"If this string does not need to preserve emojis or other non-English characters, disable this lint rule on this line or configure the 'allow' rule option.", | ||
'Otherwise, consider using `Intl.Segmenter`.', | ||
].join('\n'), |
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.
To anybody with opinions on string splitting: please bikeshed theheck out of this message!
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.
Nice!
I would prefer having the disable comment sentence as the otherwise with something like
- If you want to split on graphemes, consider using
Intl.Segmenter
- Otherwise, if this string does not need to preserve emojis ...
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.
+1. I think it makes sense to say "consider using Intl.Segmenter for robust, locale-aware string decomposition." first, and then "Otherwise, if you don't need to preserve emojis or other non-Ascii characters, disable, etc..."
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.
the people have spoken
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com>
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.
The PR has not been updated with the people's demands 😜https://github.com/typescript-eslint/typescript-eslint/pull/10751/files#r1942930884
Wondering if you forgot to push?
🤦 |
codecovbot commentedFeb 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #10751 +/- ##==========================================+ Coverage 87.26% 87.28% +0.01%========================================== Files 450 450 Lines 15715 15739 +24 Branches 4601 4609 +8 ==========================================+ Hits 13714 13737 +23 Misses 1645 1645- Partials 356 357 +1
Flags with carried forward coverage won't be shown.Click here to find out more.
|
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'd normally prefer to leave this open for a couple more days to get a full week (https://typescript-eslint.io/maintenance/pull-requests#approvals). But this is kind of a hot topic. Merging a couple days early. |
7acfb5f
intotypescript-eslint:mainUh oh!
There was an error while loading.Please reload this page.
| datasource | package | from | to || ---------- | -------------------------------- | ------ | ------ || npm | @typescript-eslint/eslint-plugin | 8.23.0 | 8.24.0 || npm | @typescript-eslint/parser | 8.23.0 | 8.24.0 |## [v8.24.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8240-2025-02-10)##### 🚀 Features- **eslint-plugin:** \[no-unnecessary-condition] make `allowConstantLoopConditions` more granular ([#10639](typescript-eslint/typescript-eslint#10639))##### 🩹 Fixes- **eslint-plugin:** \[no-misused-spread] correct and elaborate string spread report message ([#10751](typescript-eslint/typescript-eslint#10751))- **eslint-plugin:** \[restrict-plus-operands] report adding bigints to strings when `allowNumberAndString` is `false` ([#10737](typescript-eslint/typescript-eslint#10737))##### ❤️ Thank You- Josh Goldberg ✨- noah- Ronen AmielYou can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
| datasource | package | from | to || ---------- | -------------------------------- | ------ | ------ || npm | @typescript-eslint/eslint-plugin | 8.23.0 | 8.24.0 || npm | @typescript-eslint/parser | 8.23.0 | 8.24.0 |## [v8.24.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8240-2025-02-10)##### 🚀 Features- **eslint-plugin:** \[no-unnecessary-condition] make `allowConstantLoopConditions` more granular ([#10639](typescript-eslint/typescript-eslint#10639))##### 🩹 Fixes- **eslint-plugin:** \[no-misused-spread] correct and elaborate string spread report message ([#10751](typescript-eslint/typescript-eslint#10751))- **eslint-plugin:** \[restrict-plus-operands] report adding bigints to strings when `allowNumberAndString` is `false` ([#10737](typescript-eslint/typescript-eslint#10737))##### ❤️ Thank You- Josh Goldberg ✨- noah- Ronen AmielYou can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
PR Checklist
Overview
Updates the report message for a string spread to bemoanboth
...
and.split("")
.💖