-
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Description
Which packages would you like to change?
-
@eslint/compat
-
@eslint/config-array
-
@eslint/config-helpers
-
@eslint/core
-
@eslint/mcp
-
@eslint/migrate-config
-
@eslint/object-schema
-
@eslint/plugin-kit
What problem do you want to solve?
According to the docs, there is no reason to think plugins are obligated to provide a simple boolean to rule.meta.docs.recommended
; the docs simply indicate that a boolean is used internally by eslint. However, this is encoded into the type system here:
rewrite/packages/core/src/types.ts
Lines 128 to 131 in d5806df
/** | |
* Indicates if the rule is generally recommended for all users. | |
*/ | |
recommended?: boolean | undefined; |
typescript-eslint uses this field differently (see typescript-eslint/typescript-eslint#10899 (comment)), which causes a type-level incompatibility with defineConfig()
, even though there is no runtime problem.
What do you think is the correct solution?
One of the following
- Omit this field from the types entirely
- Put the type as
unknown
(and, optionally add a jsdoc note that eslint internally will always use a boolean) - Provide some union type that similarly has the effect of allowing
recommended
to be any type when used withdefineConfig()
.
Participation
- I am willing to submit a pull request for this change.
Additional comments
This is a blocker for typescript-eslint/typescript-eslint#10899.
JoshuaKGoldberg and lishaduck
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Implementing