-
Notifications
You must be signed in to change notification settings - Fork 39
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
Modernize #52
base: master
Are you sure you want to change the base?
Modernize #52
Conversation
package-lock.json
Outdated
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.
Remove this.
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, anyway package-lock.json is meant to committed: https://stackoverflow.com/questions/44206782/do-i-commit-the-package-lock-json-file-created-by-npm-5
index.ts
Outdated
/** | ||
* @typedef {(testString: string) => boolean} AnymatchFn | ||
* @typedef {string|RegExp|AnymatchFn} AnymatchPattern | ||
* @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher | ||
*/ |
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.
Shall we keep these jsdoc comments instead of turning this file into typescript? TS supports using jsdoc as typings so we don't need to convert to benefit from typing.
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.
jsdoc needs to be maintained, also index.d.ts that I removed. If you forget to update typings you risk issues like this: #40
Also typescript with noImplicitAny does a strict typing check assuring all types are correctly defined.
There are many other advantages of using typescript, like:
- having multiple targets as output, supporting both commonjs and ecmascipt modules
- using latest ecmascript features and targeting es5 keeping compatibility with nodejs versions.
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.
I know the tradeoffs. I suppose I framed the reversion as a question, but I actually meant it as "this won't land without undoing the TS change".
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.
Ah you mean you want keep the code in typescript, but use jsdoc instead of using declaring type.
Sure it can be done, but I don't see the advantage apart from reverting 3 lines change.
Typescript syntax is much more flexible and it has no much sense to keep jsodoc in a typescript project, anyway let me know what you prefer, if you want I'll revert it.
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 subscribe to https://dev.to/thepassle/using-typescript-without-compilation-3ko4 - so please put the jsdoc typings back.
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.
I read the article, personally I am totally against it, but anyway I don't want waste time discussing about. I hope one day they will standardize typings in ecmascript https://github.com/tc39/proposal-type-annotations.
For now I updated the code as you requested to use jsdoc instead of typescript, I hope you like it.
My goal was just to fix typings and make this library more maintainable with esm module support.
I did also some fixes to package.json to keep old nodeJs version compatibility and export correctly esm and cjs files.
Not sure anyway if still works with node 8, that's a pretty old node version.
I converted the project into typescript, updated dependencies and added esm module as output.