Skip to content

Commit

Permalink
Enable @typescript-eslint/member-delimiter-style and @typescript-esli…
Browse files Browse the repository at this point in the history
…nt/semi (microsoft#10172)
  • Loading branch information
tylerbutler authored and sonalivdeshpande committed May 19, 2022
1 parent b3314fd commit a4dde08
Show file tree
Hide file tree
Showing 195 changed files with 677 additions and 635 deletions.
2 changes: 1 addition & 1 deletion azure/packages/azure-client/src/AzureUrlResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function decodeAzureUrl(urlString: string): {
ordererUrl: string;
storageUrl: string;
tenantId: string;
containerId?: string,
containerId?: string;
} {
const url = new URL(urlString);
const ordererUrl = url.origin;
Expand Down
4 changes: 2 additions & 2 deletions azure/packages/azure-client/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export interface AzureClientProps {
/**
* Configuration for establishing a connection with the Azure Fluid Relay.
*/
readonly connection: AzureConnectionConfig,
readonly connection: AzureConnectionConfig;
/**
* Optional. A logger instance to receive diagnostic messages.
*/
readonly logger?: ITelemetryBaseLogger,
readonly logger?: ITelemetryBaseLogger;
}

/**
Expand Down
18 changes: 18 additions & 0 deletions common/build/eslint-config-fluid/minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,28 @@ module.exports = {
"@typescript-eslint/comma-spacing": "error",
"@typescript-eslint/func-call-spacing": "error",
"@typescript-eslint/keyword-spacing": "error",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": true
},
"multilineDetection": "brackets"
},
],
"@typescript-eslint/object-curly-spacing": [
"error",
"always",
],
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/space-before-function-paren": [
"error",
{
Expand Down
13 changes: 12 additions & 1 deletion common/build/eslint-config-fluid/printed-configs/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,18 @@
"error"
],
"@typescript-eslint/member-delimiter-style": [
"off"
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"multilineDetection": "brackets",
"singleline": {
"delimiter": "semi",
"requireLast": true
}
}
],
"@typescript-eslint/member-ordering": [
"off"
Expand Down
13 changes: 12 additions & 1 deletion common/build/eslint-config-fluid/printed-configs/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,18 @@
"error"
],
"@typescript-eslint/member-delimiter-style": [
"off"
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"multilineDetection": "brackets",
"singleline": {
"delimiter": "semi",
"requireLast": true
}
}
],
"@typescript-eslint/member-ordering": [
"off"
Expand Down
2 changes: 1 addition & 1 deletion common/lib/container-definitions/src/browserPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface IFluidBrowserPackage extends IFluidPackage {
* {@inheritDoc @fluidframework/core-interfaces#IFluidPackage.fluid.environment}
*/
[environment: string]: IFluidPackageEnvironment;
}
};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion common/lib/container-definitions/src/deltas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface IDeltaHandlerStrategy {
declare module "@fluidframework/core-interfaces" {
interface IFluidObject {
/** @deprecated - use `FluidObject<IDeltaSender>` instead */
readonly IDeltaSender?: IDeltaSender
readonly IDeltaSender?: IDeltaSender;
}
}

Expand Down
2 changes: 1 addition & 1 deletion common/lib/container-definitions/src/fluidPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface IFluidPackageEnvironment {
* of Library, the entrypoint for umd packages
*/
[key: string]: unknown;
}
};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion common/lib/container-definitions/src/legacy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface IProvideFluidTokenProvider {
* @deprecated - This will be removed in a later release.
*/
export interface IFluidTokenProvider extends IProvideFluidTokenProvider {
intelligence: { [service: string]: any };
intelligence: { [service: string]: any; };
}

declare module "@fluidframework/core-interfaces" {
Expand Down
8 changes: 4 additions & 4 deletions common/lib/container-definitions/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
* be true when the proposal is accepted, and false if
* the proposal is rejected.
*/
proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>
proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;

/**
* Attaches the Container to the Container specified by the given Request.
Expand Down Expand Up @@ -393,7 +393,7 @@ export type ILoaderOptions = {
/**
* Max time(in ms) container will wait for a leave message of a disconnected client.
*/
maxClientLeaveWaitTime?: number,
maxClientLeaveWaitTime?: number;
};

/**
Expand Down Expand Up @@ -443,7 +443,7 @@ export interface IContainerLoadMode {
* Also there might be a lot of trailing ops and applying them might take time, so hosts are
* recommended to have some progress UX / cancellation built into loading flow when using this option.
*/
| "all"
| "all";
deltaConnection?:
/*
* Connection to delta stream is made only when Container.resume() call is made. Op processing
Expand All @@ -462,7 +462,7 @@ export interface IContainerLoadMode {
* Ops processing is enabled and ops are flowing through the system.
* Default value.
*/
| undefined
| undefined;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion common/lib/container-definitions/src/tokenProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export interface IProvideFluidTokenProvider {
}

export interface IFluidTokenProvider extends IProvideFluidTokenProvider {
intelligence: { [service: string]: any };
intelligence: { [service: string]: any; };
}
2 changes: 1 addition & 1 deletion common/lib/core-interfaces/src/fluidObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IFluidObject {
/**
* @deprecated - use `FluidObject<IFluidRunnable>` instead
*/
readonly IFluidRunnable?: IFluidRunnable
readonly IFluidRunnable?: IFluidRunnable;
/**
* @deprecated - use `FluidObject<IFluidRouter>` instead
*/
Expand Down
2 changes: 1 addition & 1 deletion common/lib/core-interfaces/src/fluidPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface IFluidPackageEnvironment {
* of Library, the entrypoint for umd packages
*/
[key: string]: unknown;
}
};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion common/lib/core-interfaces/src/fluidRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface IResponse {
mimeType: string;
status: number;
value: any;
headers?: { [key: string]: any };
headers?: { [key: string]: any; };
stack?: string;
}

Expand Down
6 changes: 3 additions & 3 deletions common/lib/core-interfaces/src/test/types/fluidObjectTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ declare function getIFluidObject(): IFluidObject;
// validate nested property is FluidObject too
{
interface IFoo {
z: { z: { z: boolean } };
z: { z: { z: boolean; }; };
}

const foo: FluidObject<IFoo> = getFluidObject();
Expand All @@ -117,15 +117,15 @@ declare function getIFluidObject(): IFluidObject;
// validate provider inheritance
{
interface IProvideFooParent{
IFooParent: IFooParent
IFooParent: IFooParent;
}

interface IFooParent extends Partial<IProvideFooParent>{
parent();
}

interface IFooProvideChild {
IFooChild: IFooChild
IFooChild: IFooChild;
}

interface IFooChild extends IFooParent, Partial<IFooProvideChild>{
Expand Down
2 changes: 1 addition & 1 deletion common/lib/driver-definitions/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export interface IDocumentDeltaConnection extends IDisposable, IEventProvider<ID
* to better understand server environment etc. and use it in case error occurs.
* Format: "prop1:val1;prop2:val2;prop3:val3"
*/
relayServiceAgent?: string,
relayServiceAgent?: string;

/**
* Submit a new message to the server
Expand Down
6 changes: 3 additions & 3 deletions common/lib/driver-definitions/src/urlResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export interface IFluidResolvedUrl extends IResolvedUrlBase {
/**
* The id of the container this resolved url is for.
*/
id: string,
id: string;
url: string;
tokens: { [name: string]: string };
endpoints: { [name: string]: string };
tokens: { [name: string]: string; };
endpoints: { [name: string]: string; };
}

/**
Expand Down
6 changes: 3 additions & 3 deletions common/lib/protocol-definitions/src/consensus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ export interface IProposal {
/**
* Similar to IProposal except includes the sequence number when it was made in addition to the fields on IProposal
*/
export type ISequencedProposal = { sequenceNumber: number } & IProposal;
export type ISequencedProposal = { sequenceNumber: number; } & IProposal;

/**
* Adds the sequence number at which the message was approved to an ISequencedProposal
*/
export type IApprovedProposal = { approvalSequenceNumber: number } & ISequencedProposal;
export type IApprovedProposal = { approvalSequenceNumber: number; } & ISequencedProposal;

/**
* Adds the sequence number at which the message was committed to an IApprovedProposal
*/
export type ICommittedProposal = { commitSequenceNumber: number } & IApprovedProposal;
export type ICommittedProposal = { commitSequenceNumber: number; } & IApprovedProposal;

/**
* Events fired by a Quorum in response to client tracking.
Expand Down
4 changes: 2 additions & 2 deletions common/lib/protocol-definitions/src/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface IConnect {
* separated by ";" which server can log to better understand client environment etc.
* Format: "prop1:val1;prop2:val2;prop3:val3"
*/
relayUserAgent?: string,
relayUserAgent?: string;
}

/**
Expand Down Expand Up @@ -164,5 +164,5 @@ export interface IConnected {
* to better understand server environment etc. and use it in case error occurs.
* Format: "prop1:val1;prop2:val2;prop3:val3"
*/
relayServiceAgent?: string,
relayServiceAgent?: string;
}
6 changes: 3 additions & 3 deletions common/lib/protocol-definitions/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ export interface ITree {

export interface ISnapshotTree {
id?: string;
blobs: { [path: string]: string };
trees: { [path: string]: ISnapshotTree };
blobs: { [path: string]: string; };
trees: { [path: string]: ISnapshotTree; };
// Indicates that this tree is unreferenced. If this is not present, the tree is considered referenced.
unreferenced?: true;
}

export interface ISnapshotTreeEx extends ISnapshotTree {
id: string;
trees: { [path: string]: ISnapshotTreeEx };
trees: { [path: string]: ISnapshotTreeEx; };
}

/**
Expand Down
2 changes: 1 addition & 1 deletion common/lib/protocol-definitions/src/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export interface ISummaryTree {
type: SummaryType.Tree;

// TODO type I can infer from SummaryObject. File mode I may want to directly specify so have symlink+exec access
tree: { [path: string]: SummaryObject };
tree: { [path: string]: SummaryObject; };

// Indicates that this tree entry is unreferenced. If this is not present, the tree entry is considered referenced.
unreferenced?: true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface ISpacesStorage<T> extends EventEmitter {
* @param serializableItemData - The data of the item to add.
* @returns A unique key corresponding to the added item.
*/
addItem(serializableItemData: Serializable<T>, layout?: Layout): string
addItem(serializableItemData: Serializable<T>, layout?: Layout): string;
/**
* Removes the item specified by the given key.
* @param key - The key referring to the item to remove.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "./spacesStorageStyle.css";

interface ISpacesEditButtonProps {
clickCallback(): void;
title: string,
title: string;
}

const SpacesEditButton: React.FC<ISpacesEditButtonProps> =
Expand Down Expand Up @@ -90,7 +90,7 @@ const SpacesItemView: React.FC<ISpacesItemViewProps> =

// Stronger typing here maybe?
interface ISpacesStorageViewProps<T = any> {
getViewForItem: (item: Serializable<T>) => Promise<JSX.Element | undefined>,
getViewForItem: (item: Serializable<T>) => Promise<JSX.Element | undefined>;
getUrlForItem: (itemId: string) => string;
storage: ISpacesStorage<T>;
editable: boolean;
Expand Down
2 changes: 1 addition & 1 deletion examples/data-objects/prosemirror/src/fluidBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class ProseMirrorTransactionBuilder {

let currentGroup: IThingGroup | undefined;
const groups = new Array<IThingGroup>();
const annotations: { from: number, to: number, segment: ISegment, propertyDeltas?: any }[] = [];
const annotations: { from: number; to: number; segment: ISegment; propertyDeltas?: any; }[] = [];
let position = 0;

for (const thing of this.things) {
Expand Down
2 changes: 1 addition & 1 deletion examples/data-objects/table-document/src/cellrange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function parseRange(range: string) {
export class CellRange {
constructor(
private readonly interval: SequenceInterval,
private readonly resolve: (localRef: LocalReference) => { row: number; col: number },
private readonly resolve: (localRef: LocalReference) => { row: number; col: number; },
) {
// Ensure CellInterval was not created with a null/undefined interval.
assert(!!interval, "CellInterval created with bad interval!");
Expand Down
2 changes: 1 addition & 1 deletion examples/data-objects/table-document/src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface ITableDocumentEvents extends IEvent {
* @deprecated - TableDocument is an abandoned prototype. Please use SharedMatrix with
* the IMatrixProducer/Consumer interfaces instead.
*/
export class TableDocument extends DataObject<{ Events: ITableDocumentEvents }> implements ITable {
export class TableDocument extends DataObject<{ Events: ITableDocumentEvents; }> implements ITable {
public static getFactory() { return TableDocument.factory; }

private static readonly factory = new DataObjectFactory(
Expand Down
2 changes: 1 addition & 1 deletion examples/data-objects/table-document/src/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ITableSliceConfig {
maxCol: number;
}

export class TableSlice extends DataObject<{ InitialState: ITableSliceConfig }> implements ITable {
export class TableSlice extends DataObject<{ InitialState: ITableSliceConfig; }> implements ITable {
public static getFactory() { return TableSlice.factory; }

private static readonly factory = new DataObjectFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ describeLoaderCompat("Table Document with Interception", (getTestObjectProvider)

// Sample interface used for storing the details of a cell.
interface ICellType {
row: number,
col: number,
value: string,
row: number;
col: number;
value: string;
}

function orderSequentially(callback: () => void): void {
Expand Down
2 changes: 1 addition & 1 deletion examples/data-objects/todo/src/TextBox/TextBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const TextBoxName = `${pkg.name as string}-textbox`;
* TextBox is a really simple component that uses the CollaborativeTextArea to provide a
* collaborative textarea.
*/
export class TextBox extends DataObject<{ InitialState: string }> implements IFluidHTMLView {
export class TextBox extends DataObject<{ InitialState: string; }> implements IFluidHTMLView {
public get IFluidHTMLView() { return this; }

private text: SharedString | undefined;
Expand Down
Loading

0 comments on commit a4dde08

Please sign in to comment.