-
-
Notifications
You must be signed in to change notification settings - Fork 49
chore(no-sync): remove @typescript-eslint/utils
#449
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
base: master
Are you sure you want to change the base?
chore(no-sync): remove @typescript-eslint/utils
#449
Conversation
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.
Pull Request Overview
This PR removes the @typescript-eslint/utils
dependency and inlines its parser services logic.
- Removed
@typescript-eslint/utils
frompackage.json
. - Reimplemented
getParserServices
inlib/util/get-parser-services.js
with custom error handling and parser detection.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
package.json | dropped @typescript-eslint/utils dependency |
lib/util/get-parser-services.js | added inline parserServices logic, error messages, and a flag for type-info requirements |
Comments suppressed due to low confidence (1)
lib/util/get-parser-services.js:58
- This error branch is newly introduced but lacks corresponding tests. Add unit tests to cover the scenario where parserServices.program is null and allowWithoutFullTypeInformation is false to ensure throwError is invoked as expected.
if (parserServices.program == null && !allowWithoutFullTypeInformation) {
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.
Generally love this change 💜
Thank you
lib/util/get-parser-services.js
Outdated
// Not using tseslint parser? | ||
module.exports = function getParserServices( | ||
context, | ||
allowWithoutFullTypeInformation = false |
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 think we should just assume this is always false, and not give the options to change this here.
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.
Thanks, updated!
Tried improving the JSDoc, too.
CC/ @JoshuaKGoldberg |
5b3c683
to
e67e523
Compare
- Removes the dependency on `typescript`, a peer dependency of `@typescript-eslint/utils`
e67e523
to
d9b69bb
Compare
Description
@typescript-eslint/utils
, which hastypescript
as a peer dependency.Update the
getParserServices
function to handle parser services directly without relying on the removed utility.Related issues
Warning received while installing
eslint-plugin-n
on JS projects withouttypescript
: