Skip to content

feat: create standalone project-service, tsconfig-utils packages #11182

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

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented May 6, 2025

PR Checklist

Overview

Creates two new packages:

  • @typescript-eslint/project-service: with the createProjectService function used by @typescript-eslint/typescript-estree within @typescript-eslint/parser
  • @typescript-eslint/tsconfig-utils: with the getParsedConfigFile function used in both the newly moved createProjectService and not-moved useProvidedPrograms function

Neither have any runtime dependencies on any ESLint or other typescript-eslint packages. The only internal production package dependency is project-service relying on @typescript-eslint/types for the shared ProjectServiceOptions interface.

Notably does not change the @typescript-eslint/types package, even though that's where ProjectServiceOptions is declared right now. Moving that interface into the new @typescript-eslint/project-service package would mean ParserOptions would have a dependency on a package with runtime code. No go.

💖

@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.

Copy link

netlify bot commented May 6, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 572acf5
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/682cad4ca3aa8e0008e087c1
😎 Deploy Preview https://deploy-preview-11182--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 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (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 your Netlify project configuration.

Copy link

nx-cloud bot commented May 6, 2025

View your CI Pipeline Execution ↗ for commit 572acf5.

Command Status Duration Result
nx test eslint-plugin --coverage=false ✅ Succeeded 4m 58s View ↗
nx run-many -t typecheck ✅ Succeeded 2m 11s View ↗
nx run integration-tests:test ✅ Succeeded 45s View ↗
nx test typescript-estree --coverage=false ✅ Succeeded 19s View ↗
nx run types:build ✅ Succeeded <1s View ↗
nx test eslint-plugin-internal --coverage=false ✅ Succeeded 6s View ↗
nx run-many -t lint ✅ Succeeded 9s View ↗
nx typecheck ast-spec ✅ Succeeded <1s View ↗
Additional runs (29) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-05-20 16:39:29 UTC

) {
const options = typeof optionsRaw === 'object' ? optionsRaw : {};

validateDefaultProjectForFilesGlob(options.allowDefaultProject);
Copy link
Member Author

@JoshuaKGoldberg JoshuaKGoldberg May 6, 2025

Choose a reason for hiding this comment

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

I created this populateProjectService function here so that it could be what runs validateDefaultProjectForFilesGlob, instead of createProjectService. This way we don't need to also move validateDefaultProjectForFilesGlob into the new @typescript-eslint/project-service package.

In other words: validating default project globs is not a part of the new package. That's still specific to typescript-estree.

Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 98.85057% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.91%. Comparing base (9335077) to head (572acf5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...pt-estree/src/parseSettings/createParseSettings.ts 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11182      +/-   ##
==========================================
- Coverage   90.92%   90.91%   -0.01%     
==========================================
  Files         499      501       +2     
  Lines       50847    50869      +22     
  Branches     8384     8382       -2     
==========================================
+ Hits        46233    46248      +15     
- Misses       4599     4606       +7     
  Partials       15       15              
Flag Coverage Δ
unittest 90.91% <98.85%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
...ckages/project-service/src/createProjectService.ts 98.27% <100.00%> (ø)
...ect-service/src/getParsedConfigFileFromTSServer.ts 100.00% <100.00%> (ø)
packages/tsconfig-utils/src/compilerOptions.ts 100.00% <100.00%> (ø)
packages/tsconfig-utils/src/getParsedConfigFile.ts 91.30% <100.00%> (ø)
...ges/typescript-estree/src/create-program/shared.ts 87.80% <100.00%> (-0.57%) ⬇️
...t-estree/src/create-program/useProvidedPrograms.ts 100.00% <100.00%> (ø)
...escript-estree/src/useProgramFromProjectService.ts 100.00% <100.00%> (ø)
...pt-estree/src/parseSettings/createParseSettings.ts 92.14% <94.11%> (-0.04%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review May 12, 2025 12:10
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft May 12, 2025 12:10
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the standalone-project-service branch 2 times, most recently from b32a113 to caa57bb Compare May 12, 2025 14:42
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review May 12, 2025 14:42
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team and bradzacher May 12, 2025 14:42
bradzacher
bradzacher previously approved these changes May 19, 2025
Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

Please update and align with latest main

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
@JoshuaKGoldberg JoshuaKGoldberg merged commit 4ad8a07 into typescript-eslint:main May 21, 2025
64 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the standalone-project-service branch May 21, 2025 11:42
@fisker
Copy link
Contributor

fisker commented May 21, 2025

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2025
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.

Enhancement: Split out a @typescript-eslint/project-service package
4 participants