Skip to content

Commit

Permalink
fix: linting errors for storybook compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
johnflank committed Apr 20, 2022
1 parent 49a5bad commit 2279b93
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
8 changes: 7 additions & 1 deletion src/api/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ export const Config = axios.create({
}
});

for (const client of [IncidentCommander, Logs, CanaryChecker, Config, ConfigDB]) {
for (const client of [
IncidentCommander,
Logs,
CanaryChecker,
Config,
ConfigDB
]) {
client.interceptors.response.use(
(response) => response,
(error) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/HypothesisBuilder/evidence-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function EvidenceItem({ evidence }) {
export function EvidenceAccordion({ title, date, children, ...rest }) {
const [expanded, setExpanded] = useState(false);
return (
<div className="border-b last:border-b-0 flex flex-col">
<div className="border-b last:border-b-0 flex flex-col" {...rest}>
<button
className={`${
expanded && "border-b"
Expand Down
3 changes: 1 addition & 2 deletions src/components/Incidents/IncidentCreate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
import React from "react";
import { Controller, useForm } from "react-hook-form";

import { useLocation, useNavigate } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { v4 as uuidv4 } from "uuid";
import * as yup from "yup";
import { createEvidence } from "../../../api/services/evidence";
Expand Down Expand Up @@ -30,7 +30,6 @@ const validationSchema = yup
export function IncidentCreate({ callback, evidence, ...rest }) {
const navigate = useNavigate();
const user = useUser();
const location = useLocation();
const {
control,
formState: { errors },
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextInputClearable/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SearchIcon } from "@heroicons/react/solid";
import { useEffect, useState } from "react";
import { useState } from "react";
import { IoCloseCircle } from "react-icons/io5";

export function TextInputClearable({
Expand Down
17 changes: 11 additions & 6 deletions src/pages/Examples/topology-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useCallback, useState } from "react";
import { MinimalLayout } from "../../components/Layout";
import { TypologyDropdown } from "../../components/TopologyDropdown";
import { getTopology } from "../../api/services/topology";
import { topologiesFactory } from "../../data/topologies";

const topologies = topologiesFactory(22);
Expand All @@ -10,11 +9,17 @@ export const TypologyDropdownDemo = () => {
const [selectTopology, setSelectTopology] = useState(null);
const [isMulti, setIsMulti] = useState(false);
const searchTopology = useCallback(
(name) =>
new Promise((resolve, reject) => {
resolve(topologies); // todo remove this if getTopology works
// getTopology({ name }).then(({ data }) => resolve(data));
}),
// (name) =>
() =>
new Promise(
(
resolve
// , reject
) => {
resolve(topologies); // todo remove this if getTopology works
// getTopology({ name }).then(({ data }) => resolve(data));
}
),
[]
);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/config/config-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function ConfigDetailsPage() {
.finally(() => {
setIsLoading(false);
});
}, []);
}, [id]);

useEffect(() => {
const json = configDetails?.config;
Expand Down

0 comments on commit 2279b93

Please sign in to comment.