-
-
Notifications
You must be signed in to change notification settings - Fork 350
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
Extended properties cannot be override #1286
Comments
I believe the issue is that Regarding what you see in the README I think the wording is not perfect. You can add options that overwrite the configuration being extended but they will overwrite (rather than merge). This is of particular interest if you are dealing with say |
Thanks @coreyfarrell for the suggestions, but unfortunately none seem to work or I don't know what I'm doing wrong 😞
{
"branches": 75,
"extends": "../../.nycrc"
} During theses tests I've seen that nyc will go up the tree until it finds a |
I'm seeing this problem too - again coming from the monorepo approach and trying to solve this from a few different angles. The behaviour of extends seems to be broken since it takes the values coming from "extends" over any values defined in the config file. package.json
path/to/.nycrc
The resulting config that nyc loads looks like this
This needs to be fixed in https://github.com/istanbuljs/load-nyc-config and would probably be counted as another breaking change. |
Having this problem too, just to confirm as a non-monorepo-usecase. We have multiple separate packages that use a shared nycrc.yaml that we add as a node_module:
I can manually edit the extended config and nyc is definitely picking it up, but I can't override any of its options... |
I was able to work around this by creating an
const settings = require('path/to/nyc-config');
settings.exclude = settings.exclude.concat([
'nyc.config.js',
'tools/**'
]);
settings.lines = 80;
module.exports = settings; |
I am also experiencing this issue in |
I believe the issue is in here. It overwrites the configuration with extended configuration but it should be the other way around. |
Switches to extend in package.json but override in local .nycrc to work around istanbuljs/nyc#1286
For anyone else trying to work around this for a monorepo scenario, I was able to do so by adding my |
This change removes webhint's various telemetry prompts, packages, and hooks. As part of migrating hosting for webhint.io we're shutting down the telemetry service. Going forward we'll rely on telemetry from the various integrations and extension stores rather than a separate, dedicated service. Also works around a bug in nyc: istanbuljs/nyc#1286 - - - - - - - - - - - - - - - - - - - - Close #4734
Link to bug demonstration repository
We are trying to update to v15 in https://github.com/webhintio/hint, the PR is webhintio/hint#3513
And the relevant output of CI is here
Expected Behavior
webhint uses a monorepo approach where we have a common
.nycrc
file in the root of the project. In that file we set the minimum threshold to 80 for branches.Some packages might override the default configuration.
packages/hint
is one of those where thepackage.json
has annyc
property that sets"branches": 75
.Unfortunately, it seems like with the newest nyc version, properties in the
extends
file cannot be override.Observed Behavior
I've tried:
80
from extends and having75
in the package: test pass (expected as the coverage is 75.66%)80
from extends and having80
in the package: test fail (expected)80
by90
in the extends. Test fail saying the minimum threshold of 90 is not meetThis does not happen with previous nyc versions.
The documentation says:
(emphasis is mine) which maybe believe this might be intentional, but seems like a huge step back (ie.: having to have to set the coverage in each project).
Troubleshooting steps
cache: false
in my nyc configEnvironment Information
The text was updated successfully, but these errors were encountered: