Skip to content

Commit

Permalink
fix(parser): switch to babel-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
LuLaValva authored Apr 4, 2023
2 parents 2124fce + 7507527 commit edbb728
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/__snapshots__/scriptlet-ts.expected/auto.marko
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
static const x: number = 3 as const
static const x: number = 3 as const;
static function xPlus(val: number) {
return x + val;
}
static let xMap = new Map<string, number>()
$ const y: number = 3 as const
static let xMap = new Map<string, number>();
$ const y: number = 3 as const;
$ function yPlus(val: number) {
return x + val;
}
$ let yMap = new Map<string, number>()
$ let yMap = new Map<string, number>();
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
static const x: number = 3 as const
static const x: number = 3 as const;
static function xPlus(val: number) {
return x + val;
}
static let xMap = new Map<string, number>()
$ const y: number = 3 as const
static let xMap = new Map<string, number>();
$ const y: number = 3 as const;
$ function yPlus(val: number) {
return x + val;
}
$ let yMap = new Map<string, number>()
$ let yMap = new Map<string, number>();
8 changes: 4 additions & 4 deletions src/__tests__/__snapshots__/scriptlet-ts.expected/html.marko
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
static const x: number = 3 as const
static const x: number = 3 as const;
static function xPlus(val: number) {
return x + val;
}
static let xMap = new Map<string, number>()
$ const y: number = 3 as const
static let xMap = new Map<string, number>();
$ const y: number = 3 as const;
$ function yPlus(val: number) {
return x + val;
}
$ let yMap = new Map<string, number>()
$ let yMap = new Map<string, number>();
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
static const x: number = 3 as const
static const x: number = 3 as const;
static function xPlus(val: number) {
return x + val;
}
static let xMap = new Map<string, number>()
$ const y: number = 3 as const
static let xMap = new Map<string, number>();
$ const y: number = 3 as const;
$ function yPlus(val: number) {
return x + val;
}
$ let yMap = new Map<string, number>()
$ let yMap = new Map<string, number>();
8 changes: 4 additions & 4 deletions src/__tests__/fixtures/scriptlet-ts.marko
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
static const x: number = 3 as const
static const x: number = 3 as const
static function xPlus(val: number) { return x + val }
static let xMap = new Map<string, number>()
static let xMap = new Map< string , number >()

$ const y: number = 3 as const
$ const y : number = 3 as const
$ function yPlus(val: number) { return x + val }
$ let yMap = new Map<string, number>()
$ let yMap=new Map<string,number>( )
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const parsers: Record<string, Parser<Node>> = {

opts.originalText = text;
opts.markoLinePositions = [0];
opts.markoScriptParser = "babel";
opts.markoScriptParser = "babel-ts";
opts.markoPreservingSpace = false;

for (let i = 0; i < text.length; i++) {
Expand Down

0 comments on commit edbb728

Please sign in to comment.