Don't print Validation Warning for "//" comments in package.json
See original GitHub issueDo you want to request a feature or report a bug?
Feature
What is the current behavior?
package.json
doesn’t support comments. The official, npm-sanctioned way to add comments is to use "//"
key:
{ "//": "this is the first line of a comment",
"//": "this is the second line of the comment" }
Running https://repl.it/repls/ThornyHatefulVirus prints a Validation Warning:
● Validation Warning:
Unknown option "//" with value "comment" was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://facebook.github.io/jest/docs/configuration.html
What is the expected behavior?
No warning should be printed for "//"
keys.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
How do I add comments to package.json for npm install?
It in-lined comments for the scripts, but I've come to realize that those comments show up as "commands" in some tools (in VS...
Read more >no-warning-comments - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >JSON editing in Visual Studio Code
To disable validation, use the json.validate.enable setting. ... JSON with Comments ... but they are discouraged and the editor will display a warning....
Read more >Configuring Jest
It is recommended to define the configuration in a dedicated JavaScript, TypeScript or JSON file. The file will be discovered automatically, if it...
Read more >package.json - Yarn
name · Must be less than or equal to 214 characters (including the @scope/ for scoped packages). · Must not start with a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s awesome @andrew-pyle!
It’s here: https://github.com/facebook/jest/blob/c22d9f584627a1ae6c476d44f10c3c186b480722/packages/jest-validate/src/validate.js#L59-L63
What I would do (I think, haven’t tested it) is add
//
to the defaultblacklist
. Feel free to ask questions if you’re stuck 🙂This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.