-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Dont emit module resolution errors when looking up specifiers for container symbols #28558
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
Merged
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.js
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//// [jsxImportForSideEffectsNonExtantNoError.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
import * as React from "react"; | ||
|
||
import "./App.css"; // doesn't actually exist | ||
|
||
const tag = <div></div>; | ||
|
||
|
||
//// [jsxImportForSideEffectsNonExtantNoError.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
/// <reference path="react16.d.ts" /> | ||
var React = require("react"); | ||
require("./App.css"); // doesn't actually exist | ||
var tag = React.createElement("div", null); |
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.symbols
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
=== tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
import * as React from "react"; | ||
>React : Symbol(React, Decl(jsxImportForSideEffectsNonExtantNoError.tsx, 1, 6)) | ||
|
||
import "./App.css"; // doesn't actually exist | ||
|
||
const tag = <div></div>; | ||
>tag : Symbol(tag, Decl(jsxImportForSideEffectsNonExtantNoError.tsx, 5, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.types
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
import * as React from "react"; | ||
>React : typeof React | ||
|
||
import "./App.css"; // doesn't actually exist | ||
|
||
const tag = <div></div>; | ||
>tag : JSX.Element | ||
><div></div> : JSX.Element | ||
>div : any | ||
>div : any | ||
|
7 changes: 7 additions & 0 deletions
7
tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// @jsx: react | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
import * as React from "react"; | ||
|
||
import "./App.css"; // doesn't actually exist | ||
|
||
const tag = <div></div>; |
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.
Do you need to handle this at https://github.com/Microsoft/TypeScript/pull/28558/files#diff-c3ed224e4daa84352f7f1abcd23e8ccaL2273 because it can result in suggestion?
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.
Is that supposed to be a link to the diff this comment is on? Because it seems to be.
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.
Its line 2273 in the diff
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.
Ah, naw that position always passes
/*isError*/ false
, so only manufactures suggestions, anyway. Given that it doesn't check themoduleNotFoundError
flag, I assume the intent is to always generate the suggestions.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.
So the suggestion is raised only when the container name? Seems flaky then.
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.
Yeah, it probably is. I assume it was written with the estimation that the module name is resolved for all imports, rather than only-imports-with-used-exports. I didn't add the suggestion, so I'm not sure myself, though.