Skip to content

Enhancement: Support plugin.meta.namespace #11113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks done
niklaswimmer opened this issue Apr 28, 2025 · 2 comments
Open
4 tasks done

Enhancement: Support plugin.meta.namespace #11113

niklaswimmer opened this issue Apr 28, 2025 · 2 comments
Labels
enhancement New feature or request triage Waiting for team members to take a look

Comments

@niklaswimmer
Copy link

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

eslint-plugin

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

Currently, this is an invalid ESLint configuration:

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 does not work as I would intuitively expect: it does not disable the @typescript-eslint/array-type rule added by the ts/stylistic config. Instead, it disables the ts/array-type rule but leaves the @typescript-eslint/array-type rule enabled.

ESLint recently added the plugin.meta.namespace property. A plugin can use this property to specify the namespace it is using for its rule definitions. As far as I understand, the defineConfig function will then replace this namespace with the user provided namespace (ts in the above example) in all rules of the extended configurations (I think one needs to reference the config via a string, not sure though).

The end result is that the above config should work as one would intuitively expect, i.e. the array-type lint is turned off completely.

Additional Info

I originally opened this as eslint/eslint#19655 as I thought the whole namespace thing is not yet implemented, but I was told that it is and it is now up to the plugins to support it. Hence this enhancement request.

If this enhancement is accepted, I should be able to make the change and send a PR.

@niklaswimmer niklaswimmer added enhancement New feature or request triage Waiting for team members to take a look labels Apr 28, 2025
@bradzacher
Copy link
Member

ESLint recently added the plugin.meta.namespace property

Could you please link the docs on this?

@niklaswimmer
Copy link
Author

Yeah I think there is no documentation for this right now, besides rfc#126 which defined that behavior (right here to be precise).

I will circle this back to the ESLint issue I mentioned above and will ask if they can provide some documentation for it 👍

I will update this issue once there is progress on that front.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Waiting for team members to take a look
Projects
None yet
Development

No branches or pull requests

2 participants