Skip to content

fix(core): respect off severity in intermediate rulesets#2890

Open
jurijat wants to merge 1 commit intostoplightio:developfrom
jurijat:fix/respect-off-severity-in-intermediate-rulesets
Open

fix(core): respect off severity in intermediate rulesets#2890
jurijat wants to merge 1 commit intostoplightio:developfrom
jurijat:fix/respect-off-severity-in-intermediate-rulesets

Conversation

@jurijat
Copy link

@jurijat jurijat commented Feb 12, 2026

Fixes #2889.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

If indicated yes above, please describe the breaking change(s).

Before the fix:

const parent = {
  extends: [[oas, 'off']],
  rules: { 'some-rule': true }  // Re-enables rule
};

const child = {
  extends: [[parent, 'off']]  // BUG: 'some-rule' stayed enabled
};

After the fix: Same code, but now some-rule is correctly disabled

Additional context

  • Fixed bug where extends: [[ruleset, "off"]] did not disable rules that were explicitly re-enabled in intermediate rulesets
  • Added severity filtering for inherited rules when explicit severity modifier is used
  • Documentation was not edited, as it was already correct.

Test plan

  • Added 6 new test cases covering:
    • Deep nesting (4 levels with 'off')
    • Mixed severity modifiers followed by 'off'
    • Object rule modifications followed by 'off'
    • Non-recommended rules enabled then disabled by 'off'
    • Child re-enabling rules after extending with 'off'
    • Original bug scenario with intermediate rule enable

@jurijat jurijat requested a review from a team as a code owner February 12, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using extends with property off does not work as expected

1 participant