Closed as not planned
Description
The following piece of code is valid but it is parsed incorrectly:
import testData from './testData.json' assert { type: "json" };
Here's a link to the TypeScript Playground showing that the snippet above is valid JavaScript or TypeScript:
The output of tree-sitter parse
is the following:
(program [0, 0] - [1, 0]
(import_statement [0, 0] - [0, 63]
(import_clause [0, 7] - [0, 15]
(identifier [0, 7] - [0, 15]))
source: (string [0, 21] - [0, 38]
(string_fragment [0, 22] - [0, 37]))
(ERROR [0, 39] - [0, 62]
(identifier [0, 39] - [0, 45])
(identifier [0, 48] - [0, 52])
(identifier [0, 55] - [0, 59]))))
Specification for this syntax can be found here: https://nodejs.org/api/esm.html#node-imports