-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(typescript-estree): add EXPERIMENTAL_useProjectService option to use TypeScript project service #6754
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
Merged
JoshuaKGoldberg
merged 37 commits into
typescript-eslint:main
from
JoshuaKGoldberg:create-project-service
Jul 16, 2023
Merged
feat(typescript-estree): add EXPERIMENTAL_useProjectService option to use TypeScript project service #6754
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
550465b
WIP: createProjectService
JoshuaKGoldberg 6ea9f07
Merge branch 'v6' into create-project-service
JoshuaKGoldberg 05f4d99
Collected updates: reuse program; lean more into tsserver
JoshuaKGoldberg 1fed323
chore: fix website config.ts type checking
JoshuaKGoldberg ecd5d3d
Spell checking
JoshuaKGoldberg 78f8c4a
remove .only
JoshuaKGoldberg 76acaeb
Cleaned up todo comments in code and properly restrict new option
JoshuaKGoldberg a68dece
Added separate test run in CI for experimental option
JoshuaKGoldberg 6f6f02a
fix: no node-version
JoshuaKGoldberg e43145f
Remove process.env manual set
JoshuaKGoldberg 214fc8d
Fix linter config.ts
JoshuaKGoldberg a2f71a7
Tweaked project creation to try to explicitly set cwd
JoshuaKGoldberg 4ffaffa
Progress on updating unit tests for absolute paths
JoshuaKGoldberg 20d9f82
fix: add missing clearTSServerProjectService
JoshuaKGoldberg 6ef8498
Add more path relativity fixes
JoshuaKGoldberg 195462d
Lint fixes and watch program relativity
JoshuaKGoldberg 0db7485
No, not always true
JoshuaKGoldberg b583bb3
Fix around semanticInfo.test.ts
JoshuaKGoldberg 5b9ca22
Switch snapshot to inline
JoshuaKGoldberg a9aec01
perf: only openExternalProject once per project
JoshuaKGoldberg 4ab1b3d
Merge branch 'v6' into create-project-service
JoshuaKGoldberg be6cc5d
Revert "perf: only openExternalProject once per project"
JoshuaKGoldberg 80110c1
Reverted changes to allow alternate TSConfig names
JoshuaKGoldberg c326886
Remove project existence checking
JoshuaKGoldberg a5772e2
Add linting from root
JoshuaKGoldberg 128837a
Refactor CI naming a bit, and bumping to MacOS image...
JoshuaKGoldberg 4f52573
Alas, linting from root style runs out of memory
JoshuaKGoldberg b1da422
Added a test, why not
JoshuaKGoldberg 814a8ad
fix: don't fall back to default program/project creation
JoshuaKGoldberg a5180c7
Fixed up more test exclusions
JoshuaKGoldberg 37d3548
Move tsserver import to a require
JoshuaKGoldberg 00ddecd
rename: tsserverType -> ts
JoshuaKGoldberg b5d76d4
Merge branch 'v6' into create-project-service
JoshuaKGoldberg da45669
Use path.resolve, and then simplify parserSettings usage
JoshuaKGoldberg 69be30f
Merge branch 'main'
JoshuaKGoldberg 93d369c
Remove unneeded typingsInstaller
JoshuaKGoldberg 7e74202
Merge branch 'main' into create-project-service
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,4 +1,5 @@ | ||
import { ESLintUtils } from '@typescript-eslint/utils'; | ||
import path from 'path'; | ||
import type { RuleSeverity } from 'tslint'; | ||
import { Configuration } from 'tslint'; | ||
|
||
|
@@ -118,7 +119,7 @@ export default createRule<Options, MessageIds>({ | |
context, | ||
[{ rules: tslintRules, rulesDirectory: tslintRulesDirectory, lintFile }], | ||
) { | ||
const fileName = context.getFilename(); | ||
const fileName = path.resolve(context.getCwd(), context.getFilename()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explaining: with |
||
const sourceCode = context.getSourceCode().text; | ||
const services = ESLintUtils.getParserServices(context); | ||
const program = services.program; | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
This was a great thing to add!