imported function call without leading semicolon
See original GitHub issueimport {fun} from './foo'
let arr = []
fun()
…becomes…
"use strict";var _foo = require('./foo');
let arr = []
(0, _foo.fun)()
…which evaluates to TypeError: [] is not a function
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Allow importing of modules that don't use semicolons #1004
Give a option to output leading semicolon instead trailing semicolon. Trailing semicolon not compitable with Standard JS.
Read more >ecmascript 6 - Does import statement need semicolon actually?
Use semi colons when declaring variables, returning something or making variable calls, as you are declaring a variable with the import it ...
Read more >Print Hello World Without using a Semicolon in Java
Java Program to Print Hello World Without Semicolon. // Using append() method of String class. // Importing required classes.
Read more >[SOLVED] Semi-colon not supressing output - MATLAB Answers
The issue seems to be with the last two functions, namely table2array and readtable. This would be a minor issue if I had...
Read more >unnecessary-semicolon / W0301 - Pylint 2.16.0-dev ...
Unnecessary semicolon. Description: Used when a statement is ended by a semi-colon (";"), which isn't necessary (that's python, not C ;). Problematic code:....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(Oops, typo, it should be “just do the regular replacement”.)
I think it’s referring to cases like this:
Without being careful, we might transform the second line to
(0, exports.x) = 2;
, which isn’t a valid assignment. It’s from https://github.com/alangpierce/sucrase/pull/180 , where I switched the export approach to use variable replacement and changed the replacement strategy from “do the(0, f)
thing everywhere for simplicity” to a more targeted approach.If you’re reworking the code, not super-important to keep that line, I think it made more sense in the original context.
What does this comment mean?