Skip to content

Add ability to extend default optionsย #206

@JasonWeinzierl

Description

@JasonWeinzierl

There are several rules with options that accept multiple values. Adding items to these sets requires overwriting the entire set, so if you want to keep the existing defaults and simple add a few items, you must copy-paste the entire set into your config. This is inconvenient and also requires maintenance as we add items to the default sets in the future.

Introduce a new mode for extending a default set, as well as keeping existing behavior of overwriting.

Affected rules and their options with a default set:

Consider an API like the following:

    allowedStrings?: {
      mode?: "extend" | "override";
      values?: string[];
    } | string[]; // Default to "override" if array of strings.

Semi-related: #51

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