-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Don't allow .ts to appear in an import
#9646
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
Changes from 1 commit
448a480
a8c05a9
2821d98
0f134ed
359c8b1
3de8c22
2eb159e
8fc17af
297cb50
b452469
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2715,7 +2715,7 @@ namespace ts { | |
|
|
||
| /** Return ".ts" or ".tsx" if that is the extension. */ | ||
|
||
| export function tryExtractTypeScriptExtension(fileName: string): string | undefined { | ||
| return find(supportedTypescriptExtensionsWithDtsFirst, extension => fileExtensionIs(fileName, extension)); | ||
| return tryFind(supportedTypescriptExtensionsWithDtsFirst, extension => fileExtensionIs(fileName, extension)); | ||
| } | ||
| // Must have '.d.ts' first because if '.ts' goes first, that will be detected as the extension instead of '.d.ts'. | ||
| const supportedTypescriptExtensionsWithDtsFirst = supportedTypeScriptExtensions.slice().reverse(); | ||
|
||
|
|
||
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.
Hmm, I expected
findto have the type thattryFindhas right now. Why doesfindtakecallbackand notpredicate?I forgot to mention it when I ran into it last week while trying to use
find.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.
If we rename
tryFindtofind, what should we callfind?mustFind?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.
findMap? Let me go see if this function is in hoogle...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.
It's the equivalent of bind (
>>=) or something likeData.Foldable.concatMapexcept that it takesArray<T>toException<T>. So, yeah,findMapis not bad, ormapFirstormapSingle.