Skip to content
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

feat(typescript-estree): add type checker wrapper APIs to ParserServicesWithTypeInformation #6245

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Dec 18, 2022

Note: recreated in #6404

PR Checklist

Overview

Adds to ParserServicesWithTypeInformation the two most commonly used TypeScript type checking APIs: getSymbolAtLocation and getTypeAtLocation. Then converts all places in code that I could find that used either after immediately retrieving the TS node for an ES node.

Also applies a few standardizations that helped me find-and-replace:

  • const services = util.getParserServices(context) - not a variable named parserServices, or variables from { ... }
  • const checker = services.program.getTypeChecker() - not a variable named typeChecker or types, and not an intermediate program variable

Updates the Custom Rules docs page to reflect this.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@nx-cloud
Copy link

nx-cloud bot commented Dec 18, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 348eecf. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
Node 14 - nx test eslint-plugin --coverage=false
✅ Successfully ran 45 targets

Sent with 💌 from NxCloud.

@bradzacher bradzacher deleted the branch typescript-eslint:remove-partial-type-info-parse January 23, 2023 08:03
@bradzacher bradzacher closed this Jan 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants