eslint-config
eslint-config copied to clipboard
About Rule types in `@antfu/eslint-define-config`
Clear and concise description of the problem
Thanks for the great repo, as I'm using it as a template to build my own ESLint template.
As I can see that a lot of rule types have been defined in the repo (your experimental one @antfu/eslint-define-config
), but some of them are outdated due to plugin updates.
E.g.
https://github.com/antfu/eslint-define-config/blob/e00650ff81b8be2e19c3d6210801a327fe494be6/src/rules/import/newline-after-import.d.ts#L6-L9
where it now has another option exactCount?: number
Due to this now I have to do
Wondering is there any plan to sync those types? It's a bit hard to track every single plugin upgrade manually.
Suggested solution
N/A
Alternative
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
It's more like a temporary thing to experiment out and move fast. Later we will move to https://github.com/eslint-types instead.
Yep, I can see everything is experimental right now, but I wanted to know some insights about how those types will be maintained in the future.
Are those types being created manually or by some scripts? if it's manual work, then it might be really though😂
Also another thing I want to mention there, in the final bundle I'd suggest at least spilt the dts
file into one per plugin instead of all in one since 50000+
lines of code are killing my IDE🤣.
Nothing serious there tho, as I'm just being curious. Feel free to close this if discussing about it is way too early in the experimental stage
Honestly I would like to see the types inlined rather then as-is I did make a generator POC in https://github.com/eslint-types/eslint-define-config/pull/177 It can be done much easier, I guess, if it'll be something like
type Rule<A extends any[]> = 'off'|'warn'|'...'|A
type Rules1 = {
[K in keyof Rules0]: Rules0[K] extends Rule<[RuleLevel, infer O1]> ? Rule<[RuleLevel, Pure<O1>]>
}
and to cast Pure
(akaPrettify
akaDebug
) on the object to it gets reduced from interface into a type
50000+ lines of code are killing my IDE
1000s of files of code original eslint-define-config
has were killing my IDE even better (reading large amounts of files is slow on Windows, it took 20s to load types)
It's more like a temporary thing to experiment out and move fast
I'd say having JSDoc generator used in this package here would be required to make renamed types(ts/*
) - as JSDoc doesn't follow renaming
The types, however, better to come from the package, as it updates pretty often and maintaining it may be a hussle
Should be better now with https://github.com/antfu/eslint-typegen