Validate against invalid rule schema defaults in RuleTester #11473
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
breaking
This change is backwards-incompatible
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
Projects
The version of ESLint you are using.
v5.15.0
The problem you want to solve.
As of v5.14.0, we allow rule schemas to include the
default
keyword to specify default options. However, it's easy for a rule author to inadvertently use thedefault
keyword in a place where the keyword is ignored, resulting in a buggy rule. (Also see: #11427)Your take on the correct solution to problem.
When we validate rule schemas in
RuleTester
, we should use the newstrictDefaults
option in Ajv to raise an error if a rule schema has an invaliddefault
keyword.This is a breaking change for users who use
RuleTester
, becauseRuleTester
would sometimes start reporting additional validation errors. However, rules themselves would still work as before, even if they contain invalid defaults. Additionally, the impact is expected to be very low since we only added support for thedefault
keyword recently.Are you willing to submit a pull request to implement this change?
Yes
The text was updated successfully, but these errors were encountered: