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

fix(typescript-estree): pass extraFileExtensions to projectService #9051

Conversation

alfredringstad
Copy link

PR Checklist

Overview

Uses setHostConfiguration to pass extraFileExtensions to project service, when using EXPERIMENTAL_useProjectService. This fixes an issue where project service would not detect the appropriate tsconfig file when using non-default file extensions.

The tests are checking that the configFilePath is set in the compiler options. If it's not, it's an indication that the default inferred project is used. I duplicated the test cases used for the non-experimental projects option.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @alfredringstad!

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.

Copy link

netlify bot commented May 6, 2024

Deploy Preview for typescript-eslint failed.

Name Link
🔨 Latest commit 2a460d5
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66570e766083a50008b76382

@alfredringstad alfredringstad force-pushed the pass-extraFileExtensions-to-projectService branch 2 times, most recently from 5e3d1c0 to 88c1ab6 Compare May 6, 2024 11:43
@alfredringstad alfredringstad force-pushed the pass-extraFileExtensions-to-projectService branch from 88c1ab6 to c21ca49 Compare May 6, 2024 11:49
@alfredringstad alfredringstad changed the base branch from main to v8 May 8, 2024 05:49
@alfredringstad alfredringstad force-pushed the pass-extraFileExtensions-to-projectService branch from c21ca49 to a19ab95 Compare May 8, 2024 05:51
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source code changes look great to me! And checking that the config file path is found as a form of testing is very snazzy. Nicely done. 😄

Just requesting changes on docs and a few testing things that I'm open to being pushed back on - what do you think?

packages/typescript-estree/src/parser-options.ts Outdated Show resolved Hide resolved
packages/typescript-estree/src/parser-options.ts Outdated Show resolved Hide resolved
packages/typescript-estree/tests/lib/parse.test.ts Outdated Show resolved Hide resolved
@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label May 26, 2024
@bradzacher bradzacher added the bug Something isn't working label May 28, 2024
@alfredringstad alfredringstad force-pushed the pass-extraFileExtensions-to-projectService branch 2 times, most recently from 62b24c6 to 368d020 Compare May 29, 2024 06:15
@alfredringstad alfredringstad force-pushed the pass-extraFileExtensions-to-projectService branch from 368d020 to 18beb06 Compare May 29, 2024 06:30
@alfredringstad
Copy link
Author

Thanks for the feedback @JoshuaKGoldberg! I've implemented your suggestions. Seems like CI failure is due to issues in the main v8 branch, the typescript-estree tests seem to work fine.

@github-actions github-actions bot removed the awaiting response Issues waiting for a reply from the OP or another party label May 29, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Praise] 💯

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks! :shipit:

Normally I'd wait for a bit to let someone else review but I would like to unblock folks who need the extra file extensions from using the project.

packages/typescript-estree/tests/lib/parse.test.ts Outdated Show resolved Hide resolved
packages/typescript-estree/tests/lib/parse.test.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: parserOptions.projectService does not respect extraFileExtensions
3 participants