csslint
csslint copied to clipboard
writing comments inside .csslintrc throws warning
Writing comments inside .csslintrc throws following warning which aborts the process
Running "csslint:target" (csslint) task Warning: Unable to parse ".csslintrc" file (Unexpected token /). Use --force to continue.
Aborted due to warnings.
csslintrc is a data file in JSON. Comments in JSON are not allowed per the spec.
What people often do as a workaround is to add a key "_comment" for instance and hide the comment in the value.
In .jshintrc file, comments are allowed and it is also a JSON file.
It seems jshint uses strip-json-comments:
https://github.com/jshint/jshint/search?q=strip-json-comments&type=Code
Therefore, would be good to add strip-json-comments as csslint dependency. I prefer to write comments inside .csslintrc rather than going online and search for different options every now and then to find out what do they mean and how to set them up.
Agreed. This would be very helpful in keeping my .csslintrc file organized.
Does someone have time to test https://github.com/sindresorhus/strip-json-comments to see if it will work in Rhino and WSH?
@nschonni If #18 is merged in, it should work in both.
Looks like the maintainer isn't interested in supporting Rhino.
However, he did point me to something that could help: Rhino-Require.
Edit: Well, not really. Since we're building a single portable csslint-rhino.js
artifact, Rhino-Require doesn't help.