Skip to content

Commit

Permalink
Implement consistent file extensions for Typescript imports (#4492)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvergnaud authored Dec 15, 2023
1 parent d25d421 commit 28eb036
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {ParseTreeListener} from "antlr4";

<header>

<file.listenerNames:{lname | import { <lname; format="cap">Context \} from "./<file.parserName>";}; separator="\n">
<file.listenerNames:{lname | import { <lname; format="cap">Context \} from "./<file.parserName>.js";}; separator="\n">

<namedActions.beforeListener>

Expand Down Expand Up @@ -89,7 +89,7 @@ import {ParseTreeVisitor} from 'antlr4';

<header>

<file.visitorNames:{lname | import { <lname; format="cap">Context \} from "./<file.parserName>";}; separator="\n">
<file.visitorNames:{lname | import { <lname; format="cap">Context \} from "./<file.parserName>.js";}; separator="\n">

<namedActions.beforeVisitor>

Expand Down Expand Up @@ -128,7 +128,7 @@ Parser(parser, funcs, atn, sempredFuncs, superClass, isLexer=false) ::= <<

Parser_(parser, funcs, atn, sempredFuncs, ctor, superClass) ::= <<
<if(superClass)>
import <superClass> from './<superClass>';
import <superClass> from './<superClass>.js';
<endif>

export default class <parser.name> extends <superClass; null="Parser"> {
Expand Down Expand Up @@ -864,7 +864,7 @@ import {

Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass, isLexer=true) ::= <<
<if(superClass)>
import <superClass> from './<superClass>';
import <superClass> from './<superClass>.js';

<endif>
export default class <lexer.name> extends <superClass; null="Lexer"> {
Expand Down

0 comments on commit 28eb036

Please sign in to comment.