Override does not work if rule is defined as "off" by default
See original GitHub issueThis works:
module.exports = {
'root': true,
plugins: [
'example-internal',
],
rules: {},
overrides: [{
files: '**/__tests__/*.js',
rules: {
'example-internal/no-focused-tests': 2,
}
}],
};
But this does not:
module.exports = {
'root': true,
plugins: [
'example-internal',
],
rules: {
'example-internal/no-focused-tests': 0,
},
overrides: [{
files: '**/__tests__/*.js',
rules: {
'example-internal/no-focused-tests': 2,
}
}],
};
I’ve pushed a minimum repro here.
Original bug report (outdated, see below discussion)
Based on these docs and discussion threads like this one, I would expect the following rule override to be supported:
'use strict';
module.exports = {
'root': true,
plugins: [
'example-internal',
],
rules: {
// Off by default
'example-internal/no-focused-tests': 0,
},
overrides: [
{
files: '**/__tests__/*.js',
rules: {
// On for tests
'example-internal/no-focused-tests': 2,
}
}
],
};
Unfortunately my override does not seem to be working. I’ve pushed a minimum repro here. Am I overlooking something obvious?
FWIW, this relates to facebook/react/pull/11977.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
When override function with default value parameter, how to ...
The superclass is inside a framework. A project uses this framework, and want to override a function with default parameter value, but it...
Read more >Using application-default with application override
Solved: According to product help for application-default: The selected applications are allowed or denied only on their default ports defined - 5732.
Read more >12 Rules of Overriding in Java You Should Know
Rule #1:Only inherited methods can be overridden. Because overriding happens when a subclass re-implements a method inherited from a superclass, ...
Read more >Working with Override Translation Rules - Oracle Help Center
The default view is the To Be Deployed view. If you create a new rule, the rule is displayed in the list with...
Read more >Custom override rule - Akamai TechDocs
The custom override rule is always last in a configuration, unless you also have an advanced override rule. Advanced override always takes precedence...
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
Thanks, I’ll clone and investigate when I get home from work.
That was my assumption as well, but it doesn’t hold.
Yes, also happens in latest. (Can be seen in my project currently.)