-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
docs(readme): added types #660
docs(readme): added types #660
Conversation
Codecov Report
@@ Coverage Diff @@
## master #660 +/- ##
=======================================
Coverage 90.17% 90.17%
=======================================
Files 2 2
Lines 397 397
Branches 119 119
=======================================
Hits 358 358
Misses 38 38
Partials 1 1
Continue to review full report at Codecov.
|
README.md
Outdated
Type: | ||
|
||
```ts | ||
type globOptions = object; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use types from globby
, just use the same name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import("globby").Options?
sourceFilename: string; | ||
absoluteFilename: string; | ||
}[] | ||
) => any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-webpack-plugin/types/index.d.ts
Line 70 in 9b5a314
* @param {{ data: Buffer, sourceFilename: string, absoluteFilename: string }[]} data
🤔 Am I looking at the wrong type then 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add @returns
to types here too, looks like bug on our side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-webpack-plugin/types/index.d.ts
Lines 253 to 259 in 9b5a314
type TransformAllFunction = ( data: { data: Buffer; sourceFilename: string; absoluteFilename: string; }[] ) => any;
I thought this returned any
@@ -249,7 +249,7 @@ type TransformerObject = { | |||
cache?: boolean | TransformerCacheObject | undefined; | |||
}; | |||
type Transform = TransformerFunction | TransformerObject; | |||
type Filter = (filepath: string) => any; | |||
type Filter = (filepath: string) => boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add this here https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/src/index.js#L95 and run npm run build
, same for https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/src/index.js#L99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks |
This PR contains a:
Motivation / Use-Case
Changed to typescript types and standardized readme