Skip to content

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

@1cg 1cg merged commit 6a585f9 into bigskysoftware:dev Apr 24, 2025
1 check passed
@scrhartley scrhartley mentioned this pull request Apr 28, 2025
4 tasks
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

3 participants