Skip to content

Consolidate defaultOptions #51

@JasonWeinzierl

Description

@JasonWeinzierl

Right now default options for each rule is scattered in several places:

  • a defaultOptions variable declared at the top of the file
  • default values in the meta.schema so that eslint-doc-generator can read the defaults
  • when reading the config within the rule's create, we also default each value again e.g. const { allowThrowingAny = true, allowThrowingUnknown = true } = config;

ESLint 9.15 added a new meta.defaultOptions field, which typescript-eslint added support for in 8.15. We should investigate that field and see if it's suitable for consolidating our default options for each rule. We'll need to consider backward compatibility; does defaultOptions work in earlier versions of ESLint? And/or can we raise the minimum required ESLint version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions