-
-
Notifications
You must be signed in to change notification settings - Fork 75
[postcss-preset-env] TypeScript definition files #682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @GilShoshan94, We really want to have everything typed. To achieve this we need to do this :
I do not want to spend too much time on definitely typed as I'd rather spend that time converting plugins to typescript. This is low prio for us now because we have too many other changes planned. The best way to help is to find a small and simple plugin and try converting that to typescript. |
Thank you for your reply. Whish you easy translation into TypeScript. Should I close this issue or leave it open for reference? |
I understand :) You can leave it open as a reference. |
🤔 Ideally plugins export the type definition of their plugin options. |
All needed code changes have been done for this. Note to self : |
@GilShoshan94 We have released |
Thank you !!! |
Hi,
I am very new to the world of JS/TS, HTML/CSS frontend and web in general.
Coming from system programing I feel more at home with types.
I saw the issue #600 and the response that eventually the whole plugin will be in Typescript.
I am also using PNPM, Vite, and SolidJS in Typscript.
I added the types with this pacage
@types/postcss-preset-env
(link to npmjs and to the repo).Those types are not up to date, there are missing options and missing features and even deprecated features that don't exist anymore (I looked here for the options and here for the features)
So I updated locally the type definition
index.d.ts
:I saw a pull request not too old to add the new options (but didn't fix the features) but it got abbandonned, they requires tests and I am so new to this I don't feel comfortable doing it.
My question is, can those types be added directly in the
postcss-preset-env
package instead of being in another, unllinked, repo ? Even though it didn't get converted to typescript entirely yet.If not, if someone know how to write tests for this and submit it to
@types/postcss-preset-env
(link to the repo) it would help Typescript users.Have a nice day.
A technical/correctness question:
I modifed an existing TS file. But it seems a bit off to me.
To my understanding, in TS,
?
means optional parameter wich imply that it can beundefined
.So is it correct to edit this file and remove all the
| undifined
on all the optional parameters ?Another correctness question:
For all the features, the accepted type are
boolean | object
(and undifined because optional....).According to the documentation, it seems that it should be only
boolean
. Is it the case ?The text was updated successfully, but these errors were encountered: