Dear Valery Semenchuk (@VISTALL),
Please, kindly see the following issue report.
Environment
Consulo
Consulo:
version = 2020.8
build number = 2599
build date = August 16, 2020
Plugins:
com.intellij = 2599
<…>
consulo.javascript = 2894
<…>
Node
$ node --version
v12.18.3
Problem
The import statements that have the local name specified are not recognised correctly: the Consulo file editor shows the errors with the «Comma expected» message.
ECMAScript 2015 Language Specification
Such import statements are specified by the language specification.
Please, see the table: ECMAScript 2015 Language Specification – ECMA-262 6th Edition: Table 40 (Informative) — Import Forms Mappings to ImportEntry Records:
import {x as v} from "mod";
Test scenario
Precondition steps
-
Create a new JavaScript project using Consulo: specify the empty directory.
-
Add the «ECMAScript 6» extension to the project module:
- Navigate to the «Project Structure» window (File => Project Structure).
- Navigate to the «Modules» tab.
- Select the default project module.
- Navigate to the «Extensions» tab in the «Modules» tab.
- Check the «JavaScript (Client)» item (checkbox) and select the «ECMAScript 6» value in the «Default Version» combobox.
- Click the «Apply» button.
- Click the «OK» button.
-
Create the following two .mjs files:
a.mjs:
export function testA() {
console.log('testA()');
}
b.mjs:
import { testA as localTestA } from './a.mjs';
localTestA();
-
(Optional, but highly recommended.) Run the b.mjs module using node to make sure the module works fine (without errors):
$ node --experimental-modules b.mjs
(node:6011) ExperimentalWarning: The ESM module loader is experimental.
testA()
Steps
- Open the
b.mjs file in Consulo to see (edit) it the Consulo file editor.
Actual result
The Consulo file editor shows two errors with the same «Comma expected» message:

Expected result
The Consulo file editor does not show any error.
Best regards,
Sergey Brunov.
Dear Valery Semenchuk (@VISTALL),
Please, kindly see the following issue report.
Environment
Consulo
Node
Problem
The
importstatements that have the local name specified are not recognised correctly: the Consulo file editor shows the errors with the «Comma expected» message.ECMAScript 2015 Language Specification
Such
importstatements are specified by the language specification.Please, see the table: ECMAScript 2015 Language Specification – ECMA-262 6th Edition: Table 40 (Informative) — Import Forms Mappings to ImportEntry Records:
Test scenario
Precondition steps
Create a new JavaScript project using Consulo: specify the empty directory.
Add the «ECMAScript 6» extension to the project module:
Create the following two
.mjsfiles:a.mjs:b.mjs:(Optional, but highly recommended.) Run the
b.mjsmodule usingnodeto make sure the module works fine (without errors):Steps
b.mjsfile in Consulo to see (edit) it the Consulo file editor.Actual result
The Consulo file editor shows two errors with the same «Comma expected» message:

Expected result
The Consulo file editor does not show any error.
Best regards,
Sergey Brunov.