19:11
<dminor>
I'm not sure if this is the best place for this, but I'm in the process of implementing source phase imports and ran into a question about syntax errors for import source declarations: Give code like import source form "./module.mjs"; (from misspelled form) should the SyntaxError reflect parsing an import source form, or an import form? That is, is the from keyword missing at form or at "./module.mjs"?
19:17
<guybedford>
Interesting question - on first glance I'd say to me it seems most similar to import form 'x' which says unexpected string in Node.js for me. So I think "module.mjs" being the unexpected string that should be the from keyword makes sense.
19:42
<nicolo-ribaudo>
Babel also throws at the string, saying "unexpected string, expected token 'from'"
19:42
<dminor>
That was my thought as well. I would also expect that people will avoid source as import binding name once import source is available to avoid making things confusing, so it would be more useful to report an error on module.mjs.
19:43
<nicolo-ribaudo>
Yeah, I think people will stop as soon as editors start coloring source as a keyword
19:44
<guybedford>
yeah agreed we should assume the keyword intent