apply eslint and prettier rules

This commit is contained in:
Sebastian Sdorra
2019-10-21 10:57:56 +02:00
parent 85773186db
commit 4bb8e6153b
227 changed files with 1147 additions and 4076 deletions

View File

@@ -38,18 +38,7 @@ class Button extends React.Component<Props> {
};
render() {
const {
label,
loading,
disabled,
type,
color,
className,
icon,
fullWidth,
reducedMobile,
children
} = this.props;
const { label, loading, disabled, type, color, className, icon, fullWidth, reducedMobile, children } = this.props;
const loadingClass = loading ? "is-loading" : "";
const fullWidthClass = fullWidth ? "is-fullwidth" : "";
const reducedMobileClass = reducedMobile ? "is-reduced-mobile" : "";
@@ -59,14 +48,7 @@ class Button extends React.Component<Props> {
type={type}
disabled={disabled}
onClick={this.onClick}
className={classNames(
"button",
"is-" + color,
loadingClass,
fullWidthClass,
reducedMobileClass,
className
)}
className={classNames("button", "is-" + color, loadingClass, fullWidthClass, reducedMobileClass, className)}
>
<span className="icon is-medium">
<Icon name={icon} color="inherit" />
@@ -83,13 +65,7 @@ class Button extends React.Component<Props> {
type={type}
disabled={disabled}
onClick={this.onClick}
className={classNames(
"button",
"is-" + color,
loadingClass,
fullWidthClass,
className
)}
className={classNames("button", "is-" + color, loadingClass, fullWidthClass, className)}
>
{label} {children}
</button>

View File

@@ -28,11 +28,7 @@ class ButtonAddons extends React.Component<Props> {
}
});
return (
<Flex className={classNames("field", "has-addons", className)}>
{childWrapper}
</Flex>
);
return <Flex className={classNames("field", "has-addons", className)}>{childWrapper}</Flex>;
}
}

View File

@@ -21,11 +21,7 @@ class ButtonGroup extends React.Component<Props> {
}
});
return (
<div className={classNames("field", "is-grouped", className)}>
{childWrapper}
</div>
);
return <div className={classNames("field", "is-grouped", className)}>{childWrapper}</div>;
}
}

View File

@@ -18,12 +18,7 @@ class DownloadButton extends React.Component<Props> {
because jsx a does not the custom disabled attribute
but bulma does.
// @ts-ignore */}
<a
className="button is-link"
href={url}
disabled={disabled}
onClick={onClickOrDefault}
>
<a className="button is-link" href={url} disabled={disabled} onClick={onClickOrDefault}>
<span className="icon is-medium">
<i className="fas fa-arrow-circle-down" />
</span>

View File

@@ -11,27 +11,13 @@ import EditButton from "./EditButton";
import SubmitButton from "./SubmitButton";
import { ReactElement } from "react";
const colors = [
"primary",
"link",
"info",
"success",
"warning",
"danger",
"white",
"light",
"dark",
"black",
"text"
];
const colors = ["primary", "link", "info", "success", "warning", "danger", "white", "light", "dark", "black", "text"];
const Spacing = styled.div`
padding: 1em;
`;
const RoutingDecorator = story => (
<MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>
);
const RoutingDecorator = story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>;
const SpacingDecorator = story => <Spacing>{story()}</Spacing>;
@@ -65,17 +51,7 @@ buttonStory("AddButton", () => <AddButton>Add</AddButton>);
buttonStory("CreateButton", () => <CreateButton>Create</CreateButton>);
buttonStory("DeleteButton", () => <DeleteButton>Delete</DeleteButton>);
buttonStory("DownloadButton", () => (
<DownloadButton
displayName="Download"
disabled={false}
url=""
></DownloadButton>
)).add("Disabled", () => (
<DownloadButton
displayName="Download"
disabled={true}
url=""
></DownloadButton>
));
<DownloadButton displayName="Download" disabled={false} url=""></DownloadButton>
)).add("Disabled", () => <DownloadButton displayName="Download" disabled={true} url=""></DownloadButton>);
buttonStory("EditButton", () => <EditButton>Edit</EditButton>);
buttonStory("SubmitButton", () => <SubmitButton>Submit</SubmitButton>);

View File

@@ -9,6 +9,4 @@ export { default as SubmitButton } from "./SubmitButton";
export { default as DownloadButton } from "./DownloadButton";
export { default as ButtonGroup } from "./ButtonGroup";
export { default as ButtonAddons } from "./ButtonAddons";
export {
default as RemoveEntryOfTableButton
} from "./RemoveEntryOfTableButton";
export { default as RemoveEntryOfTableButton } from "./RemoveEntryOfTableButton";