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

Get rid of latest usages of substr #3074

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

scrhartley
Copy link
Contributor

Description

Follow up to #2951.
Replace more usages of deprecated String.prototype.substr.

Should I just keep making these, or perhaps we could make this a lint check or something?

Testing

Trivial change

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan added the ready for review Issues that are ready to be considered for merging label Dec 13, 2024
@scrhartley
Copy link
Contributor Author

Added commit to also update affected test file

@scrhartley
Copy link
Contributor Author

scrhartley commented Dec 13, 2024

Once this is merged I'll create another PR to add an eslint rule to enforce it in the future:

      "no-restricted-properties": ["error", {
        "property": "substr",
        "message": "Use .slice or .substring instead of .substr"
      }],

Corresponding eslint docs: https://eslint.org/docs/latest/rules/no-restricted-properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants