Skip to content

Commit

Permalink
chore: codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed May 27, 2024
1 parent 0ce9dd5 commit 828e94f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
5 changes: 4 additions & 1 deletion lib/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export class Lines {
private cachedSourceMap: any = null;
private cachedTabWidth: number | void = void 0;

constructor(private infos: LineInfo[], sourceFileName: string | null = null) {
constructor(
private infos: LineInfo[],
sourceFileName: string | null = null,
) {
invariant(infos.length > 0);
this.length = infos.length;
this.name = sourceFileName || null;
Expand Down
12 changes: 6 additions & 6 deletions lib/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,8 @@ function genericPrintNoParens(path: any, options: any, print: any) {
const separator = options.flowObjectCommas
? ","
: isTypeAnnotation
? ";"
: ",";
? ";"
: ",";
const fields = [];
let allowBreak = false;

Expand Down Expand Up @@ -2333,10 +2333,10 @@ function genericPrintNoParens(path: any, options: any, print: any) {
return concat(parts);

case "TSMethodSignature":
if (n.kind === 'get') {
parts.push('get ')
} else if (n.kind === 'set') {
parts.push('set ')
if (n.kind === "get") {
parts.push("get ");
} else if (n.kind === "set") {
parts.push("set ");
}
if (n.computed) {
parts.push("[", path.call(print, "key"), "]");
Expand Down
13 changes: 8 additions & 5 deletions test/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ for (const { title, parser } of [
});

// Esprima does not parse JSX fragments: https://github.com/jquery/esprima/issues/2020
(/esprima/i.test(title)
? xit
: it)("should parse and print fragments", function () {
check(["<>", " <td>Hello</td>", " <td>world!</td>", "</>"].join("\n"));
});
(/esprima/i.test(title) ? xit : it)(
"should parse and print fragments",
function () {
check(
["<>", " <td>Hello</td>", " <td>world!</td>", "</>"].join("\n"),
);
},
);
});
}
2 changes: 1 addition & 1 deletion test/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ const nodeMajorVersion = parseInt(process.versions.node, 10);
" a(c: (this: void, e: E) => void): void;",
"}",
]);

check([
"interface LabelledContainer<T> {",
" get label(): string;",
Expand Down

0 comments on commit 828e94f

Please sign in to comment.