Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Unreleased

- Moved typescript from dev-dependencies to dependencies as it's needed by the typescript-eslint-parser
- Added support for typescript definition files
- Cleaned up ignore files and publish contents

### 3.1.0
Expand Down
6 changes: 5 additions & 1 deletion src/language-js/reprinter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export class Reprinter implements ILanguage {
case "DebuggerStatement":
case "EmptyStatement":
case "Literal":
case "OptionalMemberExpression":
case "RestProperty":
case "SpreadElement":
case "Super":
Expand Down Expand Up @@ -323,7 +324,9 @@ export class Reprinter implements ILanguage {
break;
}
case "FunctionExpression": {
nodes.push(node.body);
if (node.body != null) {
nodes.push(node.body);
}
break;
}
case "Identifier":
Expand Down Expand Up @@ -517,6 +520,7 @@ export class Reprinter implements ILanguage {
case "TSArrayType":
case "TSAsExpression":
case "TSBooleanKeyword":
case "TSConditionalType":
case "TSConstructorType":
case "TSEnumDeclaration":
case "TSImportType":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ReprinterOptions } from "../reprinter-options";
export declare class Reprinter {
private static reprinters;
static rewriteFile(filename: string, options: ReprinterOptions): void;
static rewriteText(fileExtension: string, text: string, options: ReprinterOptions): string | undefined;
private static getReprinterForFile;
}

declare type ArgumentType<T> = T extends (...arg1: infer U) => any ? U : any;
export declare enum LoggerVerboseOption {
Quiet = 0,
Normal = 1,
Diagnostic = 2
}
export declare class LogUtils {
private static verbosity;
static log(verbosity: LoggerVerboseOption, ...args: ArgumentType<typeof console.log>): void;
static setVerbosity(newVerbosity: LoggerVerboseOption): void;
}
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ReprinterOptions } from "../reprinter-options";
export declare class Reprinter {
private static reprinters;
static rewriteFile(filename: string, options: ReprinterOptions): void;
static rewriteText(fileExtension: string, text: string, options: ReprinterOptions): string | undefined;
private static getReprinterForFile;
}

declare type ArgumentType<T> = T extends (...arg1: infer U) => any ? U : any;
export declare enum LoggerVerboseOption {
Quiet = 0,
Normal = 1,
Diagnostic = 2
}
export declare class LogUtils {
private static verbosity;
static log(verbosity: LoggerVerboseOption, ...args: ArgumentType<typeof console.log>): void;
static setVerbosity(newVerbosity: LoggerVerboseOption): void;
}
export {};