-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
At the moment, YAML files are loaded with require('js-yaml').load(), while JSON uses JSON.parse(). It might make sense to switch both of these to use require('yaml').parse() instead. This would have the following benefits:
yamlhas better YAML spec compliance; see the YAML Test Matrix, which shows results forjs-yamlas "js-yaml-json" andyamlas "js-event" and "js-json".- Safer config data loading, as the
js-yamlload() supports JavaScript being encoded in YAML files. Obviously NYC also supports .js files for config, but it might still be surprising for a config loaded from a YAML file not to be guaranteed inert. - Better error reporting, in particular for JSON files -- JSON is a subset of YAML, and can be loaded as such.
- Support for
# commentsin JSON files.
As disclosure, I'm the developer of yaml, so my opinions may be a little biased here. I'm interested, as yaml itself ends up having @istanbuljs/load-nyc-config as a dev dependency. I would be quite willing to submit a PR for this change, but thought it'd be more polite to ask first.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels