Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I havesearched for related issues and found none that match my proposal.
- I have searched thecurrent rule list and found no rules that match my proposal.
- I haveread the FAQ and my problem is not listed.
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{pluginasts}from"typescript-eslint";exportdefaultdefineConfig({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 thets/stylistic
config. Instead, it disables thets/array-type
rule but leaves the@typescript-eslint/array-type
rule enabled.
ESLint recently added theplugin.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, thedefineConfig
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. thearray-type
lint is turned off completely.
Additional Info
I originally opened this aseslint/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.