-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
chore: use typescript-eslint@v8's projectService for typed linting #11315
Closed
JoshuaKGoldberg
wants to merge
5
commits into
withastro:main
from
JoshuaKGoldberg:tseslint-project-service
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
beb3410
chore: use typescript-eslint@v8's projectService for typed linting
JoshuaKGoldberg 9497d37
chore: bumped to latest ts and tseslint
JoshuaKGoldberg 962155e
Merge branch 'main'
JoshuaKGoldberg 20d1b09
...vague attempt at a tsconfig.json
JoshuaKGoldberg fc014d3
Just to be sure, also enable noEmit
JoshuaKGoldberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
// Yes this file is intentionally empty! | ||
// Yes this file is intentionally near-empty! | ||
// --- | ||
// Having a blank `tsconfig.json` file prevents TypeScript from crawling up your directory tree | ||
// and possibly picking up a parent `tsconfig.json` (which, unsurprisingly, is very hard to debug) | ||
{} | ||
// and possibly picking up a parent `tsconfig.json` (which, unsurprisingly, is very hard to debug). | ||
// This is also used for linting out-of-project files with type information. | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"noEmit": true | ||
}, | ||
"include": [ | ||
".", | ||
"packages/upgrade/upgrade.mjs", | ||
// ...and yet: | ||
// /Users/josh/repos/astro/packages/upgrade/upgrade.mjs | ||
// 0:0 error Parsing error: /Users/josh/repos/astro/packages/upgrade/upgrade.mjs was not found by the project service. | ||
// Consider either including it in the tsconfig.json or including it in allowDefaultProject | ||
] | ||
} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Well, I figured it out. https://github.com/JoshuaKGoldberg/repros/tree/tseslint-project-service-non-included-nearest-tsconfig is a simplified reproduction.
Basically:
packages/upgrade/tsconfig.json
includes["src"]
packages/upgrade/upgrade.mjs
is not in that includesThis would be a good case to stick with
parserOptions.project
, to give more fine-grained control over what projects include each file. I filed typescript-eslint/typescript-eslint#9753 to document this better.