You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fix] order/TypeScript: properly support import = object expressions
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 import-js#1785, I'm calling this a bugfix.
Fixesimport-js#1821. Fixesimport-js#1808.
Copy file name to clipboardExpand all lines: docs/rules/order.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ import bar from './bar';
22
22
importbazfrom'./bar/baz';
23
23
// 6. "index" of the current directory
24
24
importmainfrom'./';
25
+
// 7. "object"-imports (only available in TypeScript)
26
+
import log = console.log;
25
27
```
26
28
27
29
Unassigned imports are ignored, as the order they are imported in may be important.
@@ -77,12 +79,15 @@ This rule supports the following options:
77
79
78
80
### `groups: [array]`:
79
81
80
-
How groups are defined, and the order to respect. `groups` must be an array of `string` or [`string`]. The only allowed `string`s are: `"builtin"`, `"external"`, `"internal"`, `"unknown"`, `"parent"`, `"sibling"`, `"index"`. The enforced order is the same as the order of each element in a group. Omitted types are implicitly grouped together as the last element. Example:
82
+
How groups are defined, and the order to respect. `groups` must be an array of `string` or [`string`]. The only allowed `string`s are:
0 commit comments