You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use your acorn-typescript AST helper plugin as it seems the most advanced vanillajs solution (microsoft/typescript is written in ts itself so needs itself to build itself, as well as @babel/parser, which is just a fork of acorn anyway, while the former seems to have a too complicated structure for my comprehension, but these aren't to be discussed here). When I extend acorn with it though, it's throwing an error at the first typescript syntax:
import {Parser,parse} from "./acorn/acorn/src/index.js";
import parseTypescript from "./patternfly-org/packages/ast-helpers)/acorn-typescript.js";
function compile(source,dialect){
if(dialect=="typescript")
Parser.extend(parseTypescript);
parse(source,{sourceType:"module"});
}
compile(source,"typescript");
SyntaxError: Unexpected token (4:12) {
pos: 131,
loc: Position { line: 4, column: 12 },
raisedAt: 132
}
The code at that location being:
import { version as rollupVersion } from 'package.json';
import Bundle from '../Bundle';
import Graph from '../Graph';
> import type { PluginDriver } from '../utils/PluginDriver';
[...]
Am I using it wrong or is this an unsupported typescript syntax?
Would you have recommendations on where to start fixing this?
Thanks!
The text was updated successfully, but these errors were encountered:
@bpstrngr thanks for your questions. This acorn-typescript package is something we pulled in for our own build system, but is not code that we created or are able to support for the community - the original code lives in this repo, and you have more luck troubleshooting with the author:
I'm trying to use your acorn-typescript AST helper plugin as it seems the most advanced vanillajs solution (microsoft/typescript is written in ts itself so needs itself to build itself, as well as @babel/parser, which is just a fork of acorn anyway, while the former seems to have a too complicated structure for my comprehension, but these aren't to be discussed here). When I extend acorn with it though, it's throwing an error at the first typescript syntax:
The code at that location being:
Am I using it wrong or is this an unsupported typescript syntax?
Would you have recommendations on where to start fixing this?
Thanks!
The text was updated successfully, but these errors were encountered: