run prettier

This commit is contained in:
Alex Dima 2021-11-06 00:15:13 +01:00
parent b4178b1190
commit 84bdc31efe
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
217 changed files with 22439 additions and 198788 deletions

View file

@ -32,10 +32,7 @@ const enum JSONParent {
}
class ParentsStack {
constructor(
public readonly parent: ParentsStack | null,
public readonly type: JSONParent
) {}
constructor(public readonly parent: ParentsStack | null, public readonly type: JSONParent) {}
public static pop(parents: ParentsStack | null): ParentsStack | null {
if (parents) {
@ -44,17 +41,11 @@ class ParentsStack {
return null;
}
public static push(
parents: ParentsStack | null,
type: JSONParent
): ParentsStack {
public static push(parents: ParentsStack | null, type: JSONParent): ParentsStack {
return new ParentsStack(parents, type);
}
public static equals(
a: ParentsStack | null,
b: ParentsStack | null
): boolean {
public static equals(a: ParentsStack | null, b: ParentsStack | null): boolean {
if (!a && !b) {
return true;
}
@ -95,12 +86,7 @@ class JSONState implements languages.IState {
}
public clone(): JSONState {
return new JSONState(
this._state,
this.scanError,
this.lastWasColon,
this.parents
);
return new JSONState(this._state, this.scanError, this.lastWasColon, this.parents);
}
public equals(other: languages.IState): boolean {
@ -222,8 +208,7 @@ function tokenize(
case json.SyntaxKind.StringLiteral:
const currentParent = parents ? parents.type : JSONParent.Object;
const inArray = currentParent === JSONParent.Array;
type =
lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME;
type = lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME;
lastWasColon = false;
break;
case json.SyntaxKind.NumericLiteral: