-
-
Notifications
You must be signed in to change notification settings - Fork 374
Open
Labels
Status: TriageThis is the initial status for an issue that requires triage.This is the initial status for an issue that requires triage.dependenciesPull requests that update a dependency filePull requests that update a dependency fileπ BugIndicates that the issue is a bug or defect.Indicates that the issue is a bug or defect.
Description
Describe the bug
Multiple parts of the website codebase still use the deprecated
String.prototype.substr API.
This causes linting/editor warnings
affected files (from lint output):
pages/index.page.tsxpages/blog/index.page.tsxcomponents/StyledMarkdown.tsxcomponents/Sidebar.tsxcomponents/Headlines.tsxcomponents/JsonEditor.tsxlib/getStaticMarkdownPaths.tslib/getPartsOfJson.tslib/getFindResultsByGlobalRegExp.ts
These usages should be replaced with slice or substring as appropriate.
Steps To Reproduce
- Clone json-schema-org/website and install dependencies.
- Check out the latest main branch.
- Run the linter (e.g.,
npm run lintorpnpm lint)
or open the project in an editor with ESLint enabled. - Open any of the files listed above and search for
.substr. - Observe lint/editor warnings about the deprecated substr method.
Expected Behavior
- The codebase does not use String.prototype.substr.
- All string slicing uses standard, well-supported methods
(slice or substring). - The linter and editors show no warnings related to deprecated
string APIs.
Screenshots
No response
Device Information [optional]
- OS:
- Browser:
- version:Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
No
Metadata
Metadata
Assignees
Labels
Status: TriageThis is the initial status for an issue that requires triage.This is the initial status for an issue that requires triage.dependenciesPull requests that update a dependency filePull requests that update a dependency fileπ BugIndicates that the issue is a bug or defect.Indicates that the issue is a bug or defect.