Skip to content

internal(prettier) - update prettier version #9220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 6, 2024
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
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"printWidth": 120,
"singleQuote": true
}
"singleQuote": true,
"trailingComma": "es5"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
import { SchemaRegistry } from '../schema-registry';

export class ArrayLiteralExpressionSchema extends SchemaNode {
constructor(readonly members: SchemaNode[], readonly location: SchemaLocation) {
constructor(
readonly members: SchemaNode[],
readonly location: SchemaLocation
) {
super();
}

Expand Down
7 changes: 6 additions & 1 deletion components/entities/semantic-schema/schemas/docs/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { TagName, TagSchema } from './tag';
export class DocSchema extends SchemaNode {
readonly tags?: TagSchema[];

constructor(readonly location: SchemaLocation, readonly raw: string, readonly comment?: string, tags?: TagSchema[]) {
constructor(
readonly location: SchemaLocation,
readonly raw: string,
readonly comment?: string,
tags?: TagSchema[]
) {
super();
this.tags = tags;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import { TagName, TagSchema } from './tag';
*/
export class PropertyLikeTagSchema extends TagSchema {
readonly type?: SchemaNode;
constructor(readonly location: SchemaLocation, readonly name: string, readonly comment?: string, type?: SchemaNode) {
constructor(
readonly location: SchemaLocation,
readonly name: string,
readonly comment?: string,
type?: SchemaNode
) {
super(location, TagName.parameter, comment);
this.type = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { TagName, TagSchema } from './tag';
export class ReturnTagSchema extends TagSchema {
readonly type?: SchemaNode;

constructor(readonly location: SchemaLocation, readonly comment?: string, type?: SchemaNode) {
constructor(
readonly location: SchemaLocation,
readonly comment?: string,
type?: SchemaNode
) {
super(location, TagName.return, comment);
this.type = type;
}
Expand Down
6 changes: 5 additions & 1 deletion components/entities/semantic-schema/schemas/docs/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { SchemaLocation, SchemaNode } from '../../schema-node';
* e.g. `@deprecated please use something else`
*/
export class TagSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly tagName: TagName | string, readonly comment?: string) {
constructor(
readonly location: SchemaLocation,
readonly tagName: TagName | string,
readonly comment?: string
) {
super();
}

Expand Down
7 changes: 6 additions & 1 deletion components/entities/semantic-schema/schemas/get-accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { SchemaRegistry } from '../schema-registry';

export class GetAccessorSchema extends SchemaNode {
readonly type: SchemaNode;
constructor(readonly location: SchemaLocation, readonly name: string, type: SchemaNode, readonly signature: string) {
constructor(
readonly location: SchemaLocation,
readonly name: string,
type: SchemaNode,
readonly signature: string
) {
super();
this.type = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { ParameterSchema } from './parameter';
export class IndexSignatureSchema extends SchemaNode {
readonly keyType: SchemaNode;
readonly valueType: SchemaNode;
constructor(readonly location: SchemaLocation, keyType: ParameterSchema, valueType: SchemaNode) {
constructor(
readonly location: SchemaLocation,
keyType: ParameterSchema,
valueType: SchemaNode
) {
super();
this.keyType = keyType;
this.valueType = valueType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export class IndexedAccessSchema extends SchemaNode {
readonly objectType: SchemaNode;
readonly indexType: SchemaNode;

constructor(readonly location: SchemaLocation, objectType: SchemaNode, indexType: SchemaNode) {
constructor(
readonly location: SchemaLocation,
objectType: SchemaNode,
indexType: SchemaNode
) {
super();
this.objectType = objectType;
this.indexType = indexType;
Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/keyword-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
* e.g. 'string', 'boolean', etc.
*/
export class KeywordTypeSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly name: string) {
constructor(
readonly location: SchemaLocation,
readonly name: string
) {
super();
}

Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/literal-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
* e.g. const a: 'a';
*/
export class LiteralTypeSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly name: string) {
constructor(
readonly location: SchemaLocation,
readonly name: string
) {
super();
}

Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/literal-value.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { SchemaLocation, SchemaNode } from '../schema-node';

export class LiteralValueSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly value: string) {
constructor(
readonly location: SchemaLocation,
readonly value: string
) {
super();
this.value = this.value.replace(/^['"]|['"]$/g, '');
}
Expand Down
25 changes: 16 additions & 9 deletions components/entities/semantic-schema/schemas/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export class ModuleSchema extends SchemaNode {
internals: SchemaNode[];
namespace?: string;

constructor(readonly location: SchemaLocation, exports: SchemaNode[], internals: SchemaNode[]) {
constructor(
readonly location: SchemaLocation,
exports: SchemaNode[],
internals: SchemaNode[]
) {
super();
this.exports = exports;
this.internals = internals;
Expand All @@ -20,14 +24,17 @@ export class ModuleSchema extends SchemaNode {
}

flatExportsRecursively() {
this.exports = this.exports.reduce((acc, exp) => {
if (exp instanceof ModuleSchema) {
exp.flatExportsRecursively();
if (exp.namespace) return [...acc, exp];
return [...acc, ...exp.exports];
}
return [...acc, exp];
}, [] as (ExportSchema | SchemaNode)[]);
this.exports = this.exports.reduce(
(acc, exp) => {
if (exp instanceof ModuleSchema) {
exp.flatExportsRecursively();
if (exp.namespace) return [...acc, exp];
return [...acc, ...exp.exports];
}
return [...acc, exp];
},
[] as (ExportSchema | SchemaNode)[]
);
}

toString(options?: { color?: boolean }) {
Expand Down
6 changes: 5 additions & 1 deletion components/entities/semantic-schema/schemas/named-tuple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
import { SchemaRegistry } from '../schema-registry';

export class NamedTupleSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly type: SchemaNode, readonly name?: string) {
constructor(
readonly location: SchemaLocation,
readonly type: SchemaNode,
readonly name?: string
) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
import { SchemaRegistry } from '../schema-registry';

export class ObjectLiteralExpressionSchema extends SchemaNode {
constructor(readonly members: SchemaNode[], readonly location: SchemaLocation) {
constructor(
readonly members: SchemaNode[],
readonly location: SchemaLocation
) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { SchemaRegistry } from '../schema-registry';
*/
export class ParenthesizedTypeSchema extends SchemaNode {
readonly type: SchemaNode;
constructor(readonly location: SchemaLocation, type: SchemaNode) {
constructor(
readonly location: SchemaLocation,
type: SchemaNode
) {
super();
this.type = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { SchemaRegistry } from '../schema-registry';
export class TemplateLiteralTypeSpanSchema extends SchemaNode {
type: SchemaNode;

constructor(readonly location: SchemaLocation, readonly literal: string, type: SchemaNode) {
constructor(
readonly location: SchemaLocation,
readonly literal: string,
type: SchemaNode
) {
super();
this.type = type;
}
Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/this-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
* e.g. `class A { createA(): this {} }`
*/
export class ThisTypeSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly name: string) {
constructor(
readonly location: SchemaLocation,
readonly name: string
) {
super();
}

Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/tuple-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { SchemaRegistry } from '../schema-registry';
export class TupleTypeSchema extends SchemaNode {
readonly elements: SchemaNode[];

constructor(readonly location: SchemaLocation, elements: SchemaNode[]) {
constructor(
readonly location: SchemaLocation,
elements: SchemaNode[]
) {
super();
this.elements = elements;
}
Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/type-array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { SchemaRegistry } from '../schema-registry';
export class TypeArraySchema extends SchemaNode {
readonly type: SchemaNode;

constructor(readonly location: SchemaLocation, type: SchemaNode) {
constructor(
readonly location: SchemaLocation,
type: SchemaNode
) {
super();
this.type = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { SchemaRegistry } from '../schema-registry';
export class TypeIntersectionSchema extends SchemaNode {
readonly types: SchemaNode[];

constructor(readonly location: SchemaLocation, types: SchemaNode[]) {
constructor(
readonly location: SchemaLocation,
types: SchemaNode[]
) {
super();
this.types = types;
}
Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/type-literal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { SchemaRegistry } from '../schema-registry';
export class TypeLiteralSchema extends SchemaNode {
readonly members: SchemaNode[];

constructor(readonly location: SchemaLocation, members: SchemaNode[]) {
constructor(
readonly location: SchemaLocation,
members: SchemaNode[]
) {
super();
this.members = members;
}
Expand Down
6 changes: 5 additions & 1 deletion components/entities/semantic-schema/schemas/type-operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { SchemaRegistry } from '../schema-registry';

export class TypeOperatorSchema extends SchemaNode {
type: SchemaNode;
constructor(readonly location: SchemaLocation, readonly name: string, type: SchemaNode) {
constructor(
readonly location: SchemaLocation,
readonly name: string,
type: SchemaNode
) {
super();
this.type = type;
}
Expand Down
6 changes: 5 additions & 1 deletion components/entities/semantic-schema/schemas/type-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import { SchemaRegistry } from '../schema-registry';
export class TypeQuerySchema extends SchemaNode {
readonly type: SchemaNode;

constructor(readonly location: SchemaLocation, type: SchemaNode, readonly signature: string) {
constructor(
readonly location: SchemaLocation,
type: SchemaNode,
readonly signature: string
) {
super();
this.type = type;
}
Expand Down
5 changes: 4 additions & 1 deletion components/entities/semantic-schema/schemas/type-union.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { SchemaRegistry } from '../schema-registry';

export class TypeUnionSchema extends SchemaNode {
readonly types: SchemaNode[];
constructor(readonly location: SchemaLocation, types: SchemaNode[]) {
constructor(
readonly location: SchemaLocation,
types: SchemaNode[]
) {
super();
this.types = types;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { SchemaLocation, SchemaNode } from '../schema-node';

export class UnImplementedSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly name: string, readonly type: string) {
constructor(
readonly location: SchemaLocation,
readonly name: string,
readonly type: string
) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
* wrapped in this class.
*/
export class UnknownSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly name: string, readonly schemaObj: Record<string, any>) {
constructor(
readonly location: SchemaLocation,
readonly name: string,
readonly schemaObj: Record<string, any>
) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
* e.g. exporting mdx variables in the main index.ts file.
*/
export class UnresolvedSchema extends SchemaNode {
constructor(readonly location: SchemaLocation, readonly name: string) {
constructor(
readonly location: SchemaLocation,
readonly name: string
) {
super();
}

Expand Down
5 changes: 4 additions & 1 deletion components/legacy/scope-api/lib/exceptions/lane-not-found.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { BitError } from '@teambit/bit-error';

export class LaneNotFound extends BitError {
code: number;
constructor(public scopeName: string, public laneName: string) {
constructor(
public scopeName: string,
public laneName: string
) {
let msg = `lane "${laneName}" was not found`;
msg += scopeName
? ` in scope "${scopeName}"`
Expand Down
Loading