GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Allow untyped imports · Pull Request #11446 · microsoft/TypeScript Conversation
|
|
Can you please add these test cases so we have baselines later if behavior modifies
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I find it suspicious that in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I don't think we should just be reporting |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…error when checking it
There was an error while loading. Please reload this page.
|
I went with:
We could mention that option, but this error message will be seen very often by people who simply forget to install types. Maybe we could even recommend |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Andy (Andrewkraft) (@Andy-MS) Nice - that one seems reasonable. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Nice work Andy (Andrewkraft) (@Andy-MS) ! I wrote a blogpost about this a couple of weeks ago about The one thing that keeps me from using TypeScript. This is exactly what I wanted! Also with the error message that Daniel Rosenwasser (@DanielRosenwasser) suggested. The only difference is that I suggested an extra flag called |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing the filtering in resolveModuleName, why not just return an additional piece of information on ResolvedModule call it candidateFile for instance, and that would be the location of the .js file(s) that were found during the search for the .d.ts /.ts file. In program.ts, if we found this set but no resolvedFileName is set on the ResolvedModule, but a candidateFile, then we know it is untyped.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| resolvedModule.resolvedFileName); | ||
| } | ||
|
|
||
| const newSymbol = createSymbol(SymbolFlags.ValueModule, quotedName); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
what happenes if you just return undefined? why do you need to create a symbol?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If you must, i would create a singleton UnkownModuleSymbol and check for that in isUntypedModuleSymbol
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "category": "Message", | ||
| "code": 6141 | ||
| }, | ||
| "A package for '{0}' was found at '{1}', but is untyped. Since '--noImplicitAny' is enabled, this package must have a declaration.": { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Since -> Because
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| moduleName: string, directory: string, failedLookupLocations: string[], state: ModuleResolutionState, checkOneLevel: boolean, typesOnly: boolean): ResolutionResult { | ||
| directory = normalizeSlashes(directory); | ||
| /** | ||
| * Remembers the path to a package.json for the package. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"The path to a package.json in case we find a typed version of the package further up the spine."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing in favor of #11889 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Better handling of untyped node module imports
There was an error while loading. Please reload this page.