Skip to content

Commit

Permalink
fix(code/frontend): lint errors and type check errors (#29735)
Browse files Browse the repository at this point in the history
  • Loading branch information
WangQianliang authored Feb 1, 2019
1 parent 02ac170 commit c544348
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
10 changes: 6 additions & 4 deletions x-pack/plugins/code/public/components/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface EditorActions {
hoverResult(hover: Hover): void;
}

interface Props extends EditorActions, RouteComponentProps<MainRouteParams> {
interface Props {
file: FetchFileResponse;
revealPosition?: Position;
isReferencesOpen: boolean;
Expand All @@ -41,13 +41,15 @@ interface Props extends EditorActions, RouteComponentProps<MainRouteParams> {
showBlame: boolean;
}

export class EditorComponent extends React.Component<Props> {
type IProps = Props & EditorActions & RouteComponentProps<MainRouteParams>;

export class EditorComponent extends React.Component<IProps> {
public blameWidgets: any;
private container: HTMLElement | undefined;
private monaco: MonacoHelper | undefined;
private editor: editorInterfaces.IStandaloneCodeEditor | undefined;

constructor(props: Props, context: any) {
constructor(props: IProps, context: any) {
super(props, context);
}

Expand Down Expand Up @@ -123,7 +125,7 @@ export class EditorComponent extends React.Component<Props> {

public loadBlame(blames: GitBlame[]) {
this.blameWidgets = blames.map((b, index) => {
return new BlameWidget(b, index === 0, this.editor);
return new BlameWidget(b, index === 0, this.editor!);
});
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/code/public/components/main/side_tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { EuiTab, EuiTabbedContent } from '@elastic/eui';
import { EuiTabbedContent } from '@elastic/eui';
import {
euiBorderThin,
euiColorLightestShade,
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/code/public/components/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ declare module '@elastic/eui/dist/eui_theme_light.json' {
const euiColorLightestShade: string;
const euiBorderThin: string;
const euiColorDanger: string;
const euiColorPrimary: string;
const euiColorVis0: string;
}
6 changes: 5 additions & 1 deletion x-pack/plugins/code/public/monaco/blame/blame_widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export class BlameWidget implements Editor.IContentWidget {
private domNode: HTMLDivElement;
private containerNode: HTMLDivElement;

constructor(readonly blame: GitBlame, readonly isFirstLine: boolean, readonly editor: IStand) {
constructor(
readonly blame: GitBlame,
readonly isFirstLine: boolean,
readonly editor: Editor.IStandaloneCodeEditor
) {
this.containerNode = document.createElement('div');
this.domNode = document.createElement('div');
this.containerNode.appendChild(this.domNode);
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/code/public/sagas/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function* handleMainRouteChange(action: Action<Match>) {
}
yield put(loadRepo(repoUri));
if (file) {
if ([PathTypes.blob, PathTypes.blame].includes(pathType)) {
if ([PathTypes.blob, PathTypes.blame].includes(pathType as PathTypes)) {
yield call(handleFile, repoUri, file, revision);
if (position) {
yield put(revealPosition(position));
Expand Down

0 comments on commit c544348

Please sign in to comment.