istanbuljs / babel-plugin-istanbul

A babel plugin that adds istanbul instrumentation to ES6 code
BSD 3-Clause "New" or "Revised" License
616 stars 72 forks source link

Breaking: Remove support for loading configuration from file #254

Open coreyfarrell opened 4 years ago

coreyfarrell commented 4 years ago

This module should not take responsibility for loading configuration from disk. Instead it should use the following priorities:

  1. Get configuration from plugin options if provided
  2. Take configuration from process.env.NYC_CONFIG if options were not provided
  3. Assume {} (just use default options).

Currently the third priority is to try loading options from nyc configuration file - I think this should be removed in the next semver-major. The configuration load is async and requires using spawnSync to read configuration from the babel plugins so this is bad.

This won't be an issue for jest which passes an options object to the plugin, it won't be an issue for anyone using @babel/register under nyc which sets NYC_CONFIG.