-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or request
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
Relevant Package
typescript-eslint
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
The following is neither a type nor runtime error:
tseslint.config({
extends: [
{
extends: [
{
rules: {
rule1: "error",
},
},
],
},
],
})
and it results in
[
{
extends: [
{
rules: {
rule1: "error",
},
},
],
},
]
This means that
tseslint.config(
tseslint.config({
extends: [
{
extends: [
{
rules: {
rule1: "error",
},
},
],
},
],
}),
)
results in
[
{
rules: {
rule1: "error",
},
},
]
and, therefore tseslint.config()
is not idempotent. I think we want to avoid this behavior, especially since it means that defineConfig(tseslint.config())
, which is now being promoted against our recommendation, will be similarly problematic.
Additional Info
Note that eslint core defineConfig()
does explicitly error on this case: https://github.com/eslint/rewrite/blob/0496201974aad87fdcf3aa2a63ec74e91b54825e/packages/config-helpers/src/define-config.js#L452-L454
JoshuaKGoldberg
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or request