-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(typescript-estree): default projectService.defaultProject to 'tsconfig.json' #9893
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): default projectService.defaultProject to 'tsconfig.json' #9893
Conversation
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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
fs.readFileSync( | ||
path.isAbsolute(file) ? file : path.join(getCurrentDirectory(), file), | ||
'utf-8', | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this absolute checking:
A fatal parsing error occurred: Parsing error: Could not read project service default project 'tsconfig.json': error TS5012: Cannot read file '/home/runner/work/typescript-eslint/typescript-eslint/packages/eslint-plugin-internal/tests/fixtures/tsconfig.build.json': ENOENT: no such file or directory, open '/home/runner/work/typescript-eslint/typescript-eslint/packages/eslint-plugin-internal/tests/fixtures/tsconfig.build.json'.
That tsconfig.build.json
comes from packages/typescript-estree/tsconfig.json
. The test was reading with cwd packages/typescript-estree
.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9893 +/- ##
=======================================
Coverage 88.05% 88.05%
=======================================
Files 407 407
Lines 13947 13948 +1
Branches 4071 4071
=======================================
+ Hits 12281 12282 +1
Misses 1354 1354
Partials 312 312
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
module.exports = { | ||
...require('../../jest.config.base.js'), | ||
testRegex: ['./tests/lib/.*\\.test\\.ts$'], | ||
testPathIgnorePatterns: process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE | ||
? ['/node_modules/', 'project-true'] | ||
: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parse.project-true.test.ts
never really needed to be tested with the project service on anyway. Otherwise:
Could not read project service default project 'tsconfig.json': error TS5012: Cannot read file 'tsconfig.json': ENOENT: no such file or directory, open '/Users/josh/repos/typescript-eslint/packages/typescript-estree/tests/fixtures/projectTrue/tsconfig.json'.
PR Checklist
Overview
Now,
getParsedConfigFile
will always be called, even if the user hasn't explicitly providedprojectService.defaultProject
manually. This is actually good, I think: it'll make sure the project'stsconfig.json
is valid.💖