-
Notifications
You must be signed in to change notification settings - Fork 664
fix(rome_js_formatter): Insert Space after type
for import equals declaration
#2391
Conversation
Insert a space after the `type` keyword for import equals declarations.
type
for import equals declarationtype
for import equals declaration
Parser conformance results on ubuntu-latestjs/262
jsx/babel
ts/babel
ts/microsoft
|
Deploying with Cloudflare Pages
|
import typeA = require("foo"); | ||
import type A = require("foo"); | ||
export import type = require("A"); | ||
|
||
import typeA = require("A"); | ||
import type A = require("A"); | ||
|
||
import typea = require("a"); | ||
import type a = require("a"); | ||
|
||
export import typeB = require("B"); | ||
export import type B = require("B"); | ||
|
||
export import typeb = require("b"); |
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.
@MichaReiser Does this mean that this is valid syntax??
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.
export import type B = require("B");
This is valid, yes :D I would point you to the spec if there would be any...
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.
No no, I mean, is this export import typeb = require("b");
valid?
Because this is really strange. Our testing suite makes sure that emitted code is actually valid (it parses again) and it seems that it's not doing so... so, there are two possible explanation:
- the formatter testing suite is not catching this case (it doesn't reparse) [likely]
- the parse doesn't emit any syntax errors [unlikely]
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.
(yeah valid syntax lol, an unfortunate coincidence lol)
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.
Yeah, it's valid because typeb
is a valid identifier and the type
keyword is optional.
Insert a space after the
type
keyword for import equals declarations.