Fix eslint warnings and errors

This commit is contained in:
uwap 2018-06-26 15:12:38 +02:00
parent 0a0af1cbf3
commit 24ab3990ad
7 changed files with 141 additions and 168 deletions

View file

@ -24,9 +24,10 @@ export type SideBarProps = {
export type SideBarState = {
};
class SideBar extends React.PureComponent<SideBarProps & Classes, SideBarState>
{
constructor(props: SideBarProps & Classes) {
type Props = SideBarProps & Classes;
class SideBar extends React.PureComponent<Props, SideBarState> {
constructor(props: Props) {
super(props);
}

View file

@ -16,7 +16,7 @@ export type TopBarState = {
};
export default class TopBar
extends React.PureComponent<TopBarProps, TopBarState> {
extends React.PureComponent<TopBarProps, TopBarState> {
constructor(props: TopBarProps) {
super(props);
}

View file

@ -31,7 +31,7 @@ type UiItemProps<I> = {
// eslint-disable-next-line flowtype/no-weak-types
export default class UiItem<I:Object>
extends React.PureComponent<UiItemProps<I>> {
extends React.PureComponent<UiItemProps<I>> {
constructor(props: UiItemProps<I>) {
super(props);
}

View file

@ -7,7 +7,7 @@ import { renderIcon } from "config/icon";
import type { ControlUI } from "config/flowtypes";
import { Toggle, DropDown, Link,
Section, Text, Progress, Slider } from "./UiItem";
Section, Text, Progress, Slider } from "./UiItem";
export type UiItemListProps = {
controls: Array<ControlUI>,

View file

@ -1,8 +1,8 @@
// @flow
import type { TopicType } from "config/flowtypes";
export const string: TopicType = msg => msg.toString();
export const string: TopicType = (msg) => msg.toString();
export const json = (path: string, innerType?: TopicType): TopicType => {
const parseAgain = innerType == null ? x => x : innerType;
return msg => parseAgain(JSON.parse(msg.toString())[path]);
const parseAgain = innerType == null ? (x) => x : innerType;
return (msg) => parseAgain(JSON.parse(msg.toString())[path]);
};

View file

@ -8,11 +8,11 @@ import App from "components/App";
import "../node_modules/@mdi/font/css/materialdesignicons.min.css";
import "../css/styles.css";
const Config : Config = window.config;
const config : Config = window.config;
injectTapEventPlugin();
document.title = `${Config.space.name} Map`;
document.title = `${config.space.name} Map`;
// $FlowFixMe
const contentElement: Element = document.getElementById("content");
ReactDOM.render(<App config={Config} />, contentElement);
ReactDOM.render(<App config={config} />, contentElement);