-
Notifications
You must be signed in to change notification settings - Fork 220
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
WIP: feat: typings #385
WIP: feat: typings #385
Conversation
In order to support dynamic imports we add all their contents to the main bundle as well.
Great work! What you need to do now is import the type definitions from karma and webpack, to get rid of those remaining For instance, towards the top of /** @typedef {import('karma').ConfigOptions} KarmaConfigOptions */ And then, type /**
* @param {KarmaConfigOptions} config
* @param {KarmaWebpackController} _controller
*/ You'll have an error below saying that I agree that type linting should ultimately be done in the CI |
@daKmoR Let me know how I can help. I can type things (just did this on a massive project this year so I'm pretty efficient with this type of task 😄 ) |
@matthieu-foucault thx :) |
What’s everyone’s thoughts about rewriting it in TypeScript and changing the build process? |
As discussed in #378 a solution where we have type linting but do not need to require full typescript is probably a better situation for open source projects of this type.
Also, within webpack it is handled the same way. So my vote would be for this approach typings + type linting. |
Fair enough, was just throwing the idea out there. |
fyi: just stumbled over this https://www.npmjs.com/package/@types/karma-webpack - so there are already types for karma-webpack |
Yes, this is the option I mentioned here. We can submit updates to this package later, but we don't need to use it ourselves (that's only if you want to type check your karma config). |
Hey @daKmoR is this something you are still interested in at this point? |
hey, I'm afraid that's a no... we have moved on from karma and webpack to @web/test-runner. closing this PR |
This is a WIP - do NOT merge.
This PR contains a:
Motivation / Use-Case
To prevent errors as a result of type mismatching.
closes: #378
Additional Info
This is an initial proposal - to spark a discussions on howto do the type linting and possible next steps.
PS: not 100% if everything still works as there where some small refactors needed to allow for proper typing.
PPS: Typings are pretty loose so far and I am by no means an export on this so help is definitely wanted :)
to do the linting you need to run
currently, there are no typing errors... but it would be good to do this linting in the ci?