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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

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 9364664
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/68279422fe5bc00008abf601
😎 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: 98 (🔴 down 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 9364664.

Command Status Duration Result
nx test eslint-plugin ✅ Succeeded 6m 26s View ↗
nx run eslint-plugin:test -- --coverage ✅ Succeeded 6m 31s View ↗
nx test visitor-keys ✅ Succeeded 3s View ↗
nx run types:build ✅ Succeeded 1s View ↗
nx test project-service ✅ Succeeded 5s View ↗
nx test ast-spec ✅ Succeeded 14s View ↗
nx typecheck ast-spec ✅ Succeeded 2s View ↗
nx run-many --target=build --exclude website --... ✅ Succeeded 3s View ↗
Additional runs (30) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-05-16 19:52:17 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 (05014ff) to head (9364664).

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       50845    50867      +22     
  Branches     8384     8382       -2     
==========================================
+ Hits        46231    46246      +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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
1 participant