Skip to content

Change Request: add meta.namespace and rewrite rule names from extended configs #19655

@niklaswimmer

Description

@niklaswimmer

ESLint version

9.24.0

What problem do you want to solve?

ESLint currently has confusing behavior around custom plugin keys, string based extends and rule configurations.

An example:

import { defineConfig } from "eslint/config";
import { plugin as ts } from "typescript-eslint";

export default defineConfig(
    {
        plugins: {
            ts,
        },
        extends: ["ts/stylistic"],
        rules: {
            "ts/array-type": "off",
        },
    },
);

This not work as I would intuitively expect: it does not disable the @typescript-eslint/array-type rule added by the ts/stylistic config. This is confusing because to make this work I have to know the name the plugin decided to use for its rules, but extends does not have this restrictions.

For more information and examples, see the relevant part of RFC126.

What do you think is the correct solution?

In eslint/rfcs#126 it was proposed to solve this by adding a new meta.namespace key to Plugin and have defineConfig rewrite the key used to reference a rule in the extended configurations. At least that is how I understood the solution, for more details, see the RFC text.

Participation

  • I am willing to submit a pull request for this change.

Additional comments

Since the RFC is merged, I assume the decision on this was already made? I am mainly opening this issue, because I just ran into this, remembered some talk about it in the RFC, but did not find an issue I could subscribe to for updates. I searched the issue tracker for this, but the only thing I found was #19116, which is already closed.

Metadata

Metadata

Assignees

Labels

documentationRelates to ESLint's documentationenhancementThis change enhances an existing feature of ESLint

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions