-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
CommentCompilationWarning typings #7532
Conversation
For maintainers only:
|
lib/CommentCompilationWarning.js
Outdated
* @property {number} line | ||
*/ | ||
|
||
/** @typedef {Object} Loc |
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 I add @property {number=} index
to @typedef {Object} Loc
like in compareLocations.js ==> @typedef {Object} NodeLocation
?
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.
@mohsen1 The Loc
type I have defined here is used in several locations, is there a way to not typedef
it over and over again, but just import it from a common definition file?
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.
You can import typedefs from other files. Maybe the best place is in ``Dependency.js`
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.
@ooflorent Can you make a comment on sokras comment?
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.
@mohsen1 ?
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.
Importing types from Dependency class makes sense.
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.
lib/CommentCompilationWarning.js
Outdated
* @property {number} line | ||
*/ | ||
|
||
/** @typedef {Object} Loc |
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.
You can import typedefs from other files. Maybe the best place is in ``Dependency.js`
lib/Dependency.js
Outdated
* @property {Position} end | ||
*/ | ||
|
||
exports Position; |
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.
you don't need to export types
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'll remove the exports.. and leave everything as is.
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.
@sokra done.
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
lib/CommentCompilationWarning.js
Outdated
@@ -6,7 +6,19 @@ | |||
|
|||
const WebpackError = require("./WebpackError"); | |||
|
|||
/** @typedef {import("./Module.js")} Module */ | |||
|
|||
/** @typedef {import("./Dependency.js").Position} Position */ |
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 unused type
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
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.
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.
See @mohsen1 comment
Thanks |
What kind of change does this PR introduce?
CommentCompilationWarning typings
Did you add tests for your changes?
no
Does this PR introduce a breaking change?
no
What needs to be documented once your changes are merged?
no