-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix Object-Import Errors #1823
Merged
Merged
Fix Object-Import Errors #1823
Conversation
This file contains 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
Just like ordinary `import x =` expressions, `export import x =` expressions can come with a number of different module-references. Either a require-expression such as `export import fs = require("fs")`, a literal such as `export import Console = console;` or an object-path `export import log = console.log`. This means, that the `isExport` property merely says whether the `TSImportEqualsDeclaration` has a leading `export`, but not what the `moduleReference` looks like. ---- This arguably is a semver-minor, but since it should have been included in #1785, I'm calling this a bugfix. Fixes #1821. Fixes #1808.
2 similar comments
ljharb
requested changes
Jun 13, 2020
ljharb
approved these changes
Jun 15, 2020
@ljharb do you still have a fair share of PRs to work on before the next minor or build version is released? |
Not many; I’ll look into a release soon. |
This was referenced Mar 18, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The changes I've made in PR #1785 caused object-imports to fail.
This happened because the
order
-rule is not able to handlenull
as an import-name and I totally forgot to add tests for object-imports.This PR will fix the support of object-imports by introducing a new import-type in addition to
require
andimport
: Theimport:object
-type.In order to match the
order
-rule's behavior perfectly, the object-literal being imported acts as the name which means following:Additionally there is a new import-
group
you can set for theorder
-rule called"object"
, which includes all object-imports.This new
"object"
group is in thepathGroupsExcludedImportTypes
-array by default.This PR will fix #1821 and will fix #1808
Sorry for causing trouble 😅