mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-24 04:04:13 +00:00
Update prettier to latest. Remove tslint (#1641)
* Rev up prettier * Reformat * Remove deprecated tslint * Remove call to tslint and update package-lock.json
This commit is contained in:
@@ -108,7 +108,7 @@ const makeMapDispatchToProps = (initialDispatch: Dispatch, initialProps: Noteboo
|
||||
actions.addTransform({
|
||||
mediaType: transform.MIMETYPE,
|
||||
component: transform,
|
||||
})
|
||||
}),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
this.notebookRendererRef.current,
|
||||
this.props.pendingSnapshotRequest.aspectRatio,
|
||||
[...this.props.cellOutputSnapshots.values()],
|
||||
this.props.pendingSnapshotRequest.downloadFilename
|
||||
this.props.pendingSnapshotRequest.downloadFilename,
|
||||
);
|
||||
this.props.storeNotebookSnapshot(result.imageSrc, this.props.pendingSnapshotRequest.requestId);
|
||||
} catch (error) {
|
||||
@@ -136,7 +136,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
? () => <SandboxOutputs id={id} contentRef={contentRef} />
|
||||
: undefined,
|
||||
}}
|
||||
</CodeCell>
|
||||
</CodeCell>,
|
||||
),
|
||||
markdown: ({ id, contentRef }: { id: any; contentRef: ContentRef }) =>
|
||||
decorate(
|
||||
@@ -152,7 +152,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
},
|
||||
toolbar: () => <CellToolbar id={id} contentRef={contentRef} />,
|
||||
}}
|
||||
</MarkdownCell>
|
||||
</MarkdownCell>,
|
||||
),
|
||||
|
||||
raw: ({ id, contentRef }: { id: any; contentRef: ContentRef }) =>
|
||||
@@ -169,7 +169,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
},
|
||||
toolbar: () => <CellToolbar id={id} contentRef={contentRef} />,
|
||||
}}
|
||||
</RawCell>
|
||||
</RawCell>,
|
||||
),
|
||||
}}
|
||||
</Cells>
|
||||
@@ -186,7 +186,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
|
||||
export const makeMapStateToProps = (
|
||||
initialState: CdbAppState,
|
||||
ownProps: NotebookRendererProps
|
||||
ownProps: NotebookRendererProps,
|
||||
): ((state: CdbAppState) => StateProps) => {
|
||||
const mapStateToProps = (state: CdbAppState): StateProps => {
|
||||
const { contentRef } = ownProps;
|
||||
@@ -210,7 +210,7 @@ const makeMapDispatchToProps = (initialDispatch: Dispatch, initialProps: Noteboo
|
||||
actions.addTransform({
|
||||
mediaType: transform.MIMETYPE,
|
||||
component: transform,
|
||||
})
|
||||
}),
|
||||
),
|
||||
storeNotebookSnapshot: (imageSrc: string, requestId: string) =>
|
||||
dispatch(cdbActions.storeNotebookSnapshot({ imageSrc, requestId })),
|
||||
|
||||
@@ -87,7 +87,7 @@ const makeMapStateToProps = (_state: CdbAppState, ownProps: ComponentProps): ((s
|
||||
|
||||
const mapDispatchToProps = (
|
||||
dispatch: Dispatch,
|
||||
{ id, contentRef }: { id: string; contentRef: ContentRef }
|
||||
{ id, contentRef }: { id: string; contentRef: ContentRef },
|
||||
): DispatchProps => ({
|
||||
executeCell: () => {
|
||||
dispatch(actions.executeCell({ id, contentRef }));
|
||||
@@ -95,7 +95,7 @@ const mapDispatchToProps = (
|
||||
cdbActions.traceNotebookTelemetry({
|
||||
action: Action.ExecuteCellPromptBtn,
|
||||
actionModifier: ActionModifiers.Mark,
|
||||
})
|
||||
}),
|
||||
);
|
||||
},
|
||||
stopExecution: () => dispatch(actions.interruptKernel({})),
|
||||
|
||||
@@ -8,7 +8,7 @@ describe("StatusBar", () => {
|
||||
const kernelSpecDisplayName = "python3";
|
||||
|
||||
const component = shallow(
|
||||
<StatusBar kernelStatus="kernel status" lastSaved={lastSaved} kernelSpecDisplayName={kernelSpecDisplayName} />
|
||||
<StatusBar kernelStatus="kernel status" lastSaved={lastSaved} kernelSpecDisplayName={kernelSpecDisplayName} />,
|
||||
);
|
||||
|
||||
expect(component).not.toBeNull();
|
||||
@@ -18,7 +18,7 @@ describe("StatusBar", () => {
|
||||
const kernelSpecDisplayName = "python3";
|
||||
|
||||
const component = shallow(
|
||||
<StatusBar kernelStatus="kernel status" lastSaved={lastSaved} kernelSpecDisplayName={kernelSpecDisplayName} />
|
||||
<StatusBar kernelStatus="kernel status" lastSaved={lastSaved} kernelSpecDisplayName={kernelSpecDisplayName} />,
|
||||
);
|
||||
|
||||
const shouldUpdate = component.instance().shouldComponentUpdate(
|
||||
@@ -28,7 +28,7 @@ describe("StatusBar", () => {
|
||||
kernelStatus: "kernelStatus",
|
||||
},
|
||||
undefined,
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
expect(shouldUpdate).toBe(true);
|
||||
});
|
||||
@@ -37,7 +37,7 @@ describe("StatusBar", () => {
|
||||
const kernelSpecDisplayName = "python3";
|
||||
|
||||
const component = shallow(
|
||||
<StatusBar kernelStatus="kernel status" lastSaved={lastSaved} kernelSpecDisplayName={kernelSpecDisplayName} />
|
||||
<StatusBar kernelStatus="kernel status" lastSaved={lastSaved} kernelSpecDisplayName={kernelSpecDisplayName} />,
|
||||
);
|
||||
|
||||
const shouldUpdate = component.instance().shouldComponentUpdate(
|
||||
@@ -47,7 +47,7 @@ describe("StatusBar", () => {
|
||||
kernelStatus: "kernelStatus",
|
||||
},
|
||||
undefined,
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
expect(shouldUpdate).toBe(true);
|
||||
});
|
||||
|
||||
@@ -197,7 +197,7 @@ class BaseToolbar extends React.PureComponent<ComponentProps & DispatchProps & S
|
||||
|
||||
const mapDispatchToProps = (
|
||||
dispatch: Dispatch,
|
||||
{ id, contentRef }: { id: CellId; contentRef: ContentRef }
|
||||
{ id, contentRef }: { id: CellId; contentRef: ContentRef },
|
||||
): DispatchProps => ({
|
||||
executeCell: () => dispatch(actions.executeCell({ id, contentRef })),
|
||||
insertCodeCellAbove: () => dispatch(actions.createCellAbove({ id, contentRef, cellType: "code" })),
|
||||
|
||||
@@ -144,7 +144,7 @@ export const cellTarget = {
|
||||
|
||||
function collectSource(
|
||||
connect: DragSourceConnector,
|
||||
monitor: DragSourceMonitor
|
||||
monitor: DragSourceMonitor,
|
||||
): {
|
||||
connectDragSource: ConnectDragSource;
|
||||
isDragging: boolean;
|
||||
@@ -159,7 +159,7 @@ function collectSource(
|
||||
|
||||
function collectTarget(
|
||||
connect: DropTargetConnector,
|
||||
monitor: DropTargetMonitor
|
||||
monitor: DropTargetMonitor,
|
||||
): {
|
||||
connectDropTarget: ConnectDropTarget;
|
||||
isOver: boolean;
|
||||
@@ -210,12 +210,12 @@ export class DraggableCellView extends React.Component<Props & DnDSourceProps &
|
||||
// Same thing with connectDragSource... It also needs a React Element that matches a DOM element
|
||||
<div>
|
||||
<DragHandle onClick={this.selectCell} />
|
||||
</div>
|
||||
</div>,
|
||||
)}
|
||||
{this.props.children}
|
||||
</DragHandleAnchor>
|
||||
</DragArea>
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export class PureMarkdownCell extends React.Component<ComponentProps & DispatchP
|
||||
|
||||
export const makeMapStateToProps = (
|
||||
initialState: AppState,
|
||||
ownProps: ComponentProps
|
||||
ownProps: ComponentProps,
|
||||
): ((state: AppState) => StateProps) => {
|
||||
const { id, contentRef } = ownProps;
|
||||
const mapStateToProps = (state: AppState): StateProps => {
|
||||
@@ -135,7 +135,7 @@ export const makeMapStateToProps = (
|
||||
|
||||
const makeMapDispatchToProps = (
|
||||
initialDispatch: Dispatch,
|
||||
ownProps: ComponentProps
|
||||
ownProps: ComponentProps,
|
||||
): ((dispatch: Dispatch) => DispatchProps) => {
|
||||
const { id, contentRef } = ownProps;
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export class SandboxOutputs extends React.Component<SandboxOutputsProps> {
|
||||
const { data } = (await postRobot.send(
|
||||
this.childWindow,
|
||||
"snapshotRequest",
|
||||
this.props.pendingSnapshotRequest
|
||||
this.props.pendingSnapshotRequest,
|
||||
)) as { data: SnapshotResponse };
|
||||
if (this.props.pendingSnapshotRequest.type === "notebook") {
|
||||
if (data.imageSrc === undefined) {
|
||||
@@ -145,7 +145,7 @@ export class SandboxOutputs extends React.Component<SandboxOutputsProps> {
|
||||
|
||||
export const makeMapStateToProps = (
|
||||
initialState: AppState,
|
||||
ownProps: ComponentProps
|
||||
ownProps: ComponentProps,
|
||||
): ((state: AppState) => StateProps) => {
|
||||
const mapStateToProps = (state: CdbAppState): StateProps => {
|
||||
let outputs = Immutable.List();
|
||||
@@ -181,7 +181,7 @@ export const makeMapStateToProps = (
|
||||
|
||||
export const makeMapDispatchToProps = (
|
||||
initialDispath: Dispatch,
|
||||
ownProps: ComponentProps
|
||||
ownProps: ComponentProps,
|
||||
): ((dispatch: Dispatch) => DispatchProps) => {
|
||||
const { id, contentRef } = ownProps;
|
||||
const mapDispatchToProps = (dispatch: Dispatch) => {
|
||||
@@ -194,7 +194,7 @@ export const makeMapDispatchToProps = (
|
||||
metadata,
|
||||
index: index || 0,
|
||||
mediaType,
|
||||
})
|
||||
}),
|
||||
);
|
||||
},
|
||||
storeSnapshotFragment: (cellId: string, snapshot: SnapshotFragment) =>
|
||||
@@ -209,5 +209,5 @@ export const makeMapDispatchToProps = (
|
||||
|
||||
export default connect<StateProps, DispatchProps, ComponentProps, AppState>(
|
||||
makeMapStateToProps,
|
||||
makeMapDispatchToProps
|
||||
makeMapDispatchToProps,
|
||||
)(SandboxOutputs);
|
||||
|
||||
Reference in New Issue
Block a user