Skip to content
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

unify file extension resolution logic #3032

Merged
merged 4 commits into from
May 7, 2015
Merged

unify file extension resolution logic #3032

merged 4 commits into from
May 7, 2015

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented May 5, 2015

We explicitly list ".ts" and ".d.ts" files every time we resolve files or modules. This change puts the two extensions in a list of supported extensions, and uses it everywhere. This allows for easy addition to supported extensions, e.g. the work @CyrusNajmabadi and @fdecampredon are doing.


const extensitionsToRemove = [".d.ts", ".ts", ".js"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extensionsToRemove

@@ -1974,7 +1974,7 @@
"category": "Error",
"code": 6053
},
"File '{0}' must have extension '.ts' or '.d.ts'.": {
"File '{0}' has unsupported extension. The only supported extensions are {1}.": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an unsupported extension

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did that,, then felt too hard to read; this is still grammatically correct and gives the same meaning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OR, keep it the same and make it

"File '{0}' has unsupported extension '{1}'. The only supported extensions are {2}."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather switch back to the old message then, at least it had the "or".. :D

@mhegazy
Copy link
Contributor Author

mhegazy commented May 6, 2015

Ping 🔔

@CyrusNajmabadi , @DanielRosenwasser and @vladima any more comments?

@vladima
Copy link
Contributor

vladima commented May 6, 2015

👍 LGTM

mhegazy added a commit that referenced this pull request May 7, 2015
unify file extension resolution logic
@mhegazy mhegazy merged commit 5129d7c into master May 7, 2015
@mhegazy mhegazy deleted the supportedExtensions branch May 7, 2015 21:27
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants