Parse TypeScript code into ESTree-compatible abstract syntax tree.
Fork of @typescript-eslint/typescript-estree to run on the web.
Install from NPM module.
npm install --save @expreva/tstreeIt's installed in node_modules/@expreva/tstree.
The module is built for these targets.
By using import '@expreva/tstree', it loads from build/esm.
By using require('@expreva/tstree'), it loads from build/cjs.
A minified bundle is provided in build/web.
- Copy
tstree.js, load script in HTML, and use globaltstree - Copy
tstree.js.mapfor source map
For example, an NPM script in package.json could copy to your project's public folder.
{
"scripts": {
"copy": "cp node_modules/@expreva/tstree/build/web/tstree.* ./public"
}
}import tstree from '@expreva/tstree'
tstree.parse(`
const message: string = 'Hello';
console.log(message)
`) // Syntax tree-
Forked from
typescript-eslintat version6.1.0 -
Split off the
typescript-estreepackage usinggit-filter-repo(Splitting a subfolder out into a new repository)git clone https://github.com/typescript-eslint/typescript-eslint tstree cd tstree git filter-repo --path packages/typescript-estree -
Make it run in browser: Remove use of
fs,is-glob,globby; Shim use ofpath -
Copy shared TypeScript config files
-
Make it build: Migrate to
esbuildto bundle for web, CommonJS, and ES Module -
Publish NPM module
@expreva/tstree