-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Be strict about package.json JSON syntax #61901
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
base: main
Are you sure you want to change the base?
Conversation
@typescript-bot test it |
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.
Pull Request Overview
This PR tightens JSON syntax enforcement for package.json
snippets in tests by removing trailing commas and comments, and streamlines JSON parsing in the compiler’s utility.
- Remove trailing commas across fourslash, conformance, and baseline test files
- Update
readJsonOrUndefined
to usetryParseJson
for strict parsing - Clean up import of
parseConfigFileTextToJson
Reviewed Changes
Copilot reviewed 70 out of 70 changed files in this pull request and generated no comments.
File Pattern | Description |
---|---|
tests/cases/fourslash/*.ts | Removed trailing commas in JSON test fixtures |
tests/cases/conformance/**/*.{ts,tsx} | Removed trailing commas in JSON test fixtures |
tests/baselines/reference/**/*.{js,errors.txt} | Updated expected outputs by dropping trailing commas and whitespace lines |
src/compiler/utilities.ts | Swapped custom parse helper to tryParseJson and removed unused import |
Comments suppressed due to low confidence (1)
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
It's my review, why don't get to dismiss it without context??
@typescript-bot test it |
@jakebailey Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
What about the |
This function is only used for parsing out package.json and tsbuildinfo files. |
Corsa is strict about this, so tests break in weird ways due to these random trailing commas/comments.
Be strict here, then fix the tests.