Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(typescript-estree): add defaultProject for project service#8815

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg commentedApr 1, 2024
edited
Loading

PR Checklist

Overview

Adds adefaultProject property to the existingProjectServiceOptions config object. Folks should be able to use it like:

EXPERIMENTAL_useProjectService:{allowDefaultProjectForFiles:["./*.js"],defaultProject:"./tsconfig.json"}

...except, I can't find an API to use the default project in the project service. Filing as a draft for reference while I ask about it. Chatted with@jakebailey and@sandersnin the TypeScript Discord.service.setCompilerOptionsForInferredProjects is the right API. Thanks!

❤️‍🔥

@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 onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedApr 1, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit33776db
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/661d207870ef8e0009fd296f
😎 Deploy Previewhttps://deploy-preview-8815--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedApr 1, 2024
edited
Loading

☁️ Nx Cloud Report

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

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 31 targets

Sent with 💌 fromNxCloud.

@@ -58,6 +60,40 @@ export function createProjectService(
jsDocParsingMode,
});

if (typeof options === 'object' && options.defaultProject) {
try {
const configRead = tsserver.readConfigFile(
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Fun fact:ts.readConfigFile has two unhappy paths:

  • If the config file is valid JSON but not right for TypeScript, it returns an object
  • If the config file is invalid JSON, it throws

🙌 error handling!

@codecovCodecov
Copy link

codecovbot commentedApr 1, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is90.00000% with1 lines in your changes are missing coverage. Please review.

Project coverage is 88.01%. Comparing base(ecb6b55) to head(3c64b54).
Report is 43 commits behind head on main.

❗ Current head3c64b54 differs from pull request most recent head33776db. Consider uploading reports for the commit33776db to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@##             main    #8815      +/-   ##==========================================- Coverage   88.02%   88.01%   -0.02%==========================================  Files         405      405                Lines       14089    14099      +10       Branches     4125     4127       +2     ==========================================+ Hits        12402    12409       +7- Misses       1382     1385       +3  Partials      305      305
FlagCoverage Δ
unittest88.01% <90.00%> (-0.02%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

FilesCoverage Δ
...-estree/src/create-program/createProjectService.ts77.27% <90.00%> (-6.07%)⬇️

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as ready for reviewApril 1, 2024 20:57
configRead.error,
{
getCurrentDirectory: system.getCurrentDirectory,
getCanonicalFileName: fileName => fileName,
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I couldn't figure out a way to get this to execute in tests. 🤷

@JoshuaKGoldbergJoshuaKGoldberg added this to the8.0.0 milestoneApr 4, 2024
bradzacher
bradzacher previously approved these changesApr 15, 2024
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

JoshuaKGoldberg reacted with rocket emoji
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
@JoshuaKGoldbergJoshuaKGoldberg merged commit5542aeb intotypescript-eslint:mainApr 15, 2024
@JoshuaKGoldbergJoshuaKGoldberg deleted the project-service-default-project branchApril 15, 2024 13:39
JoshuaKGoldberg added a commit that referenced this pull requestApr 19, 2024
* feat(eslint-plugin): remove formatting/layout rules* Remove "layout"* feat(typescript-estree): add defaultProject for project service (#8815)* feat(typescript-estree): add defaultProject for project service* Thanks Jake, service.setCompilerOptionsForInferredProjects* Cleaned up a bit and added happy path testing* Update packages/typescript-estree/src/parser-options.tsCo-authored-by: Brad Zacher <brad.zacher@gmail.com>---------Co-authored-by: Brad Zacher <brad.zacher@gmail.com>* feat(eslint-plugin): replace `no-new-symbol` with `no-new-native-nonconstructor` (#8895)Co-authored-by: Brad Zacher <brad.zacher@gmail.com>* Add tombstones* 'deprecated' typo* Let's mention both issues* Fix unused variable issue---------Co-authored-by: Brad Zacher <brad.zacher@gmail.com>Co-authored-by: Dave <reduckted@outlook.com>
JoshuaKGoldberg added a commit that referenced this pull requestApr 22, 2024
* feat(eslint-plugin): remove formatting/layout rules* Remove "layout"* feat(typescript-estree): add defaultProject for project service (#8815)* feat(typescript-estree): add defaultProject for project service* Thanks Jake, service.setCompilerOptionsForInferredProjects* Cleaned up a bit and added happy path testing* Update packages/typescript-estree/src/parser-options.tsCo-authored-by: Brad Zacher <brad.zacher@gmail.com>---------Co-authored-by: Brad Zacher <brad.zacher@gmail.com>* feat(eslint-plugin): replace `no-new-symbol` with `no-new-native-nonconstructor` (#8895)Co-authored-by: Brad Zacher <brad.zacher@gmail.com>* Add tombstones* 'deprecated' typo* Let's mention both issues* Fix unused variable issue---------Co-authored-by: Brad Zacher <brad.zacher@gmail.com>Co-authored-by: Dave <reduckted@outlook.com>
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 23, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@bradzacherbradzacherbradzacher approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
8.0.0
Development

Successfully merging this pull request may close these issues.

Bug: Project service doesn't infer compilerOptions for files not included in a tsconfig.json
2 participants
@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp