[@types/eslint] rules
option not typed
#53901
Replies: 2 comments 1 reply
-
It's not typed because it is very hard to actually type it, and it would rely upon the user being able to specify all their plugin types ahead of time. Someone would also have to maintain types for each plugin by manually converting JSON schemas to TS types. A lot of plugins aren't written in TS - so it's unlikely that they will do it themselves. ESLint core is a good example of this. I think there's value in a typed config ecosystem - but I don't think doing it via DefinitelyTyped is the correct way to do it. |
Beta Was this translation helpful? Give feedback.
-
And who is doing this "a lot that could be done"? Which is why I was getting at in my response.
There aren't that many people who want to contribute to the ESLint world. There are less still that want to contribute to the subset of ESLint types. There are even less still that would want to contribute to types for ESLint plugins.
Assuming the plugin authors are active and willing to merge a (breaking change) to "fix" their schema. Defining the types by itself in an extensible way that allows all plugins to ambiently include their types into the one interface isn't especially easy. Again - I'm not saying that it's not possible to do this --- It's all very much technically possible. I just think that it's not easily maintainable, and ultimately does not provide a lot of benefit vs the very probable and very real risk that the types will fall quickly out of date with nobody updating them. IMO loose types ( |
Beta Was this translation helpful? Give feedback.
-
I've made a feature request to TypeScript to add
typeof import()
by literal string type. Currently it's awaiting feedback, and I thought it would be wise to ask authors of typings it might mostly affect to give it.As I understand,
eslint
lacks typing for rules, because rules get imported dynamically, and there is no way to put types there without this new language feature. Here's how it could look like:Live version.
Would this new language feature help typing
eslint
? Please, leave any feedback on the mentioned issue. Probably, it would make sense to keep this issue open until it gets implemented.@pmdartus @j-f1 @saadq @JasonHK @bradzacher @JounQin
Beta Was this translation helpful? Give feedback.
All reactions