Updated project linter rules and ran it

This commit is contained in:
Laszlo Fogas
2019-11-15 10:50:46 +01:00
parent 12279686e8
commit 824a206ee4
28 changed files with 109 additions and 102 deletions

View File

@@ -5,7 +5,7 @@ import Status from "../status";
import {
STATUS_FAILURE,
STATUS_RUNNING,
STATUS_SUCCESS
STATUS_SUCCESS,
} from "shared/constants/status";
jest.dontMock("../status");
@@ -16,10 +16,10 @@ describe("Status component", () => {
const instance = status.instance();
expect(
instance.shouldComponentUpdate({ status: STATUS_FAILURE })
instance.shouldComponentUpdate({ status: STATUS_FAILURE }),
).toBeFalsy();
expect(
instance.shouldComponentUpdate({ status: STATUS_SUCCESS })
instance.shouldComponentUpdate({ status: STATUS_SUCCESS }),
).toBeTruthy();
expect(status.hasClass("failure")).toBeTruthy();
});

View File

@@ -5,7 +5,7 @@ export default class Avatar extends Component {
render() {
const image = this.props.image;
const style = {
backgroundImage: `url(${image})`
backgroundImage: `url(${image})`,
};
return <div className={styles.avatar} style={style} />;
}

View File

@@ -5,12 +5,12 @@ import {
DeployIcon,
LaunchIcon,
MergeIcon,
TagIcon
TagIcon,
} from "shared/components/icons/index";
import {
EVENT_TAG,
EVENT_PULL_REQUEST,
EVENT_DEPLOY
EVENT_DEPLOY,
} from "shared/constants/events";
import styles from "./build_event.less";
@@ -40,13 +40,15 @@ export default class BuildEvent extends Component {
)}
</div>
<div>
{event === EVENT_TAG && refs
? trimTagRef(refs)
: event === EVENT_PULL_REQUEST && refspec
? trimMergeRef(refs)
: event === EVENT_DEPLOY && target
? target
: branch}
{event === EVENT_TAG && refs ? (
trimTagRef(refs)
) : event === EVENT_PULL_REQUEST && refspec ? (
trimMergeRef(refs)
) : event === EVENT_DEPLOY && target ? (
target
) : (
branch
)}
</div>
</div>
<a href={link} target="_blank">

View File

@@ -41,5 +41,5 @@ export {
StarIcon,
SyncIcon,
TagIcon,
TimelapseIcon
TimelapseIcon,
};

View File

@@ -10,7 +10,7 @@ import {
STATUS_RUNNING,
STATUS_SKIPPED,
STATUS_STARTED,
STATUS_SUCCESS
STATUS_SUCCESS,
} from "shared/constants/status";
import style from "./status.less";
@@ -19,7 +19,7 @@ import {
CloseIcon,
ClockIcon,
RefreshIcon,
RemoveIcon
RemoveIcon,
} from "./icons/index";
const defaultIconSize = 15;

View File

@@ -19,5 +19,5 @@ export {
STATUS_RUNNING,
STATUS_SKIPPED,
STATUS_SUCCESS,
STATUS_STARTED
STATUS_STARTED,
};

View File

@@ -20,7 +20,7 @@ export function fetchLogs(tree, client, owner, repo, build, proc) {
const slug = repositorySlug(owner, repo);
const init = {
data: [],
loading: true
loading: true,
};
tree.set(["logs", "data", slug, build, proc], init);