Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

[New rule] avoid-substring #1201

Closed
fzyzcjy opened this issue Mar 1, 2023 · 5 comments
Closed

[New rule] avoid-substring #1201

fzyzcjy opened this issue Mar 1, 2023 · 5 comments
Assignees
Labels
area-rules type: enhancement New feature or request
Milestone

Comments

@fzyzcjy
Copy link
Contributor

fzyzcjy commented Mar 1, 2023

Rule details

As we know, using String.substring method will cause problems if you are having emojis in the string. There are many articles in the web, such as dart-lang/sdk#35798. Users should replace s.substring(100,200) with s.characters.getRange(100,200).

What type of rule is this?

Warns about a potential problem

Example code

s.substring(100,200); // LINT


### Participation

- [ ] I am willing to submit a pull request to implement this rule.

### Additional comments

_No response_
@incendial
Copy link
Member

@fzyzcjy do you want to implement it yourself? If not, all new rules implemented by me are added to the Teams version only.

@incendial
Copy link
Member

I'd also be happy to give you the Teams version license for your effort on DCM. If you're interested, please mail me at [email protected]

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Mar 2, 2023

@incendial Hi, I do not have a strong need for the Teams license currently, but thanks for providing the license to me!

@lsaudon
Copy link
Contributor

lsaudon commented Mar 11, 2023

I'm going to do it.

@incendial incendial added the waiting for release Will be available after new version is released label Mar 17, 2023
@incendial incendial added this to the 5.7.0 milestone Mar 17, 2023
@incendial
Copy link
Member

Available in 5.7.0 🚀

@incendial incendial removed the waiting for release Will be available after new version is released label Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-rules type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants