Skip to content

[eslint-plugin] Match ESLint rules with options #862

@LayZeeDK

Description

@LayZeeDK

User story

As a Code PushUp user,
I want to use a prefix or regex/glob pattern to specify the slug of an audit configuration
So that I can target ESLint rules with custom options like @typescript-eslint/naming-convention without having to specify their hash suffix, including ESLint rules that are commonly project-specific like @angular-eslint/component-selector

{
  "plugins": [
    {
      "groups": [
        {
          "refs": [
            {
              "slug": "typescript-eslint-naming-convention-09e76a48765f01e8",
              "weight": 1
            },
            {
              "slug": "angular-eslint-component-selector-574c6d42a4038009",
              "weight": 1
            },
            {
              "slug": "angular-eslint-component-selector-cfc91be936ea54f4",
              "weight": 1
            },
            {
              "slug": "angular-eslint-component-selector-9a4cd2aa001aa5b4",
              "weight": 1
            },
          ]
        }
      ]
    }
  ]
}

Example ouput of code-pushup print-config.

Acceptance criteria

  • I can enable an ESLint rule that has options specified, simply by specifying the rule slug as a prefix, glob pattern, or regular expression in the configuration, for example:
    • typescript-eslint-naming-convention
    • typescript-eslint-naming-convention-
    • typescript-eslint-naming-convention-*
    • typescript-eslint-naming-convention-[a-f0-9]+
  • I can enable an ESLint rule that has project-specific options specified, simply by specifying the rule slug as a prefix, glob pattern, or regular expression in the configuration, for example:
    • angular-eslint-component-selector
    • angular-eslint-component-selector-
    • angular-eslint-component-selector-*
    • angular-eslint-component-selector-[a-f0-9]+

Implementation details

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions