File tree Expand file tree Collapse file tree 5 files changed +12
-9
lines changed Expand file tree Collapse file tree 5 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 66
77- fix: parse type assertions ([ #1 ] ( https://github.com/sveltejs/acorn-typescript/pull/1 ) )
88
9- ## acorn-typescript
9+ ## 1.0.0 / acorn-typescript
10+
11+ This project started as a fork of https://github.com/TyrealHu/acorn-typescript
12+
13+ Version 1.0 of ` @sveltejs/acorn-typescript ` has some breaking changes compared to the original ` acorn-typescript ` project:
14+
15+ - Only named export (i.e. you have to do ` import { tsPlugin } from '@sveltejs/acorn-typescript'; ` , a default export is no longer provided)
16+ - ESM only (no CJS build)
1017
1118Changelog of the project this originated from: https://github.com/TyrealHu/acorn-typescript/CHANGELOG.md
Original file line number Diff line number Diff line change 11import { describe , it , expect } from 'vitest' ;
22import * as acorn from 'acorn' ;
3- import tsPlugin from '../../src' ;
3+ import { tsPlugin } from '../../src' ;
44import type { AcornTypeScript } from '../../src/types' ;
55
66function checkAcornTypeScriptUndefined ( acornTypeScript ?: AcornTypeScript ) : boolean {
Original file line number Diff line number Diff line change 11import { assert } from 'vitest' ;
22import * as acorn from 'acorn' ;
3- import tsPlugin from '../src' ;
3+ import { tsPlugin } from '../src' ;
44
55export const Parser = acorn . Parser . extend ( tsPlugin ( ) ) ;
66
Original file line number Diff line number Diff line change 11import { Parser } from 'acorn' ;
22
3- declare function tsPlugin ( options ?: {
3+ export function tsPlugin ( options ?: {
44 dts ?: boolean ;
55 allowSatisfies ?: boolean ;
66 /** Whether to use JSX. Defaults to false */
@@ -11,5 +11,3 @@ declare function tsPlugin(options?: {
1111 allowNamespacedObjects ?: boolean ;
1212 } ;
1313} ) : ( BaseParser : typeof Parser ) => typeof Parser ;
14-
15- export { tsPlugin , tsPlugin as default } ;
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ function keywordTypeFromName(value: string): Node | typeof undefined {
140140 }
141141}
142142
143- function tsPlugin ( options ?: {
143+ export function tsPlugin ( options ?: {
144144 // default false
145145 dts ?: boolean ;
146146 // default false
@@ -5272,5 +5272,3 @@ function tsPlugin(options?: {
52725272 return TypeScriptParser ;
52735273 } ;
52745274}
5275-
5276- export { tsPlugin as default , tsPlugin } ;
You can’t perform that action at this time.
0 commit comments