Skip to content

Commit 8854514

Browse files
committed
fix: linting issues
1 parent 52deb81 commit 8854514

File tree

7 files changed

+79
-52
lines changed

7 files changed

+79
-52
lines changed

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
},
6+
extends: ["eslint:recommended", "plugin:react/recommended"],
7+
globals: {
8+
Atomics: "readonly",
9+
SharedArrayBuffer: "readonly",
10+
},
11+
parserOptions: {
12+
ecmaFeatures: {
13+
jsx: true,
14+
},
15+
ecmaVersion: 2020,
16+
sourceType: "module",
17+
},
18+
plugins: ["react"],
19+
rules: {
20+
"react/prop-types": ["off"],
21+
},
22+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
"@storybook/preset-create-react-app": "^3.1.4",
6363
"@storybook/react": "^6.0.25",
6464
"babel-loader": "^8.1.0",
65+
"eslint": "^7.12.1",
66+
"eslint-plugin-react": "^7.21.5",
6567
"gh-pages": "^3.1.0",
6668
"react-is": "^16.13.1"
6769
},

src/components/ControllableWave/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect } from "react"
1+
import React from "react"
22
import MouseTransformHandler from "../MouseTransformHandler"
33
import Matrix from "immutable-transform-matrix"
44
import Wave from "../Wave"
@@ -9,7 +9,6 @@ export const ControllableWave = ({
99
curves,
1010
topLevelMatrix,
1111
setTopLevelMatrix,
12-
wave,
1312
width,
1413
height,
1514
onDragDuration,

src/components/DurationBox/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const DurationBox = ({
7373

7474
return (
7575
<Box
76+
key={i}
7677
color={color}
7778
x={startX}
7879
width={endX - startX}

src/components/ReactTimeSeries/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useMemo } from "react"
1+
import React, { useMemo } from "react"
22
import { setIn } from "seamless-immutable"
33
import useEventCallback from "use-event-callback"
44
import { useAsyncMemo } from "use-async-memo"
@@ -22,6 +22,7 @@ const defaultEnabledTools = [
2222
const defaultGraphs = [{ keyName: "value" }]
2323

2424
export const ReactTimeSeriesWithoutContext = ({
25+
// eslint-disable-next-line
2526
corsProxy = defaultCorsProxy,
2627
interface: iface,
2728
sample,
@@ -32,10 +33,14 @@ export const ReactTimeSeriesWithoutContext = ({
3233
const getRandomColorUsingHash = useGetRandomColorUsingHash()
3334
const {
3435
timeFormat,
36+
// eslint-disable-next-line
3537
enabledTools = defaultEnabledTools,
38+
// eslint-disable-next-line
3639
durationLabels = emptyAr,
40+
// eslint-disable-next-line
3741
timestampLabels = emptyAr,
3842
graphs = defaultGraphs,
43+
// eslint-disable-next-line
3944
allowCustomLabels,
4045
} = iface
4146
let { timeData: sampleTimeData, audioUrl, csvUrl, annotation } = sample

src/components/TimeStamp/index.js

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,51 @@ import Color from "color"
55
import useEventCallback from "use-event-callback"
66
import useToolMode from "../../hooks/use-tool-mode"
77

8-
export const Container = styled("div")(
9-
({ left, color, textColor, hasIcon }) => ({
10-
position: "absolute",
11-
bottom: 2,
12-
fontSize: 14,
13-
fontWeight: 600,
14-
whiteSpace: "pre",
15-
...(hasIcon
16-
? {
17-
left: left - 14,
18-
bottom: -8,
19-
padding: 4,
20-
}
21-
: {
22-
borderLeft: `1px solid ${color}`,
23-
left: left,
24-
padding: 4,
25-
paddingLeft: 6,
26-
paddingRight: 6,
27-
backgroundColor: Color(color).darken(0.5).fade(0.2).string(),
28-
}),
29-
color: "#fff",
30-
cursor: "pointer",
31-
"&:hover": hasIcon
32-
? {
33-
backgroundColor: Color(color).fade(0.5).string(),
34-
}
35-
: {
36-
backgroundColor: Color(color).darken(0.6).string(),
37-
},
38-
"& .icon": {
39-
color: color,
40-
width: 20,
41-
height: 20,
42-
},
43-
"& .stem": hasIcon
44-
? {}
45-
: {
46-
position: "absolute",
47-
left: -1,
48-
bottom: -2,
49-
width: 1,
50-
height: 2,
51-
backgroundColor: color,
52-
},
53-
})
54-
)
8+
export const Container = styled("div")(({ left, color, hasIcon }) => ({
9+
position: "absolute",
10+
bottom: 2,
11+
fontSize: 14,
12+
fontWeight: 600,
13+
whiteSpace: "pre",
14+
...(hasIcon
15+
? {
16+
left: left - 14,
17+
bottom: -8,
18+
padding: 4,
19+
}
20+
: {
21+
borderLeft: `1px solid ${color}`,
22+
left: left,
23+
padding: 4,
24+
paddingLeft: 6,
25+
paddingRight: 6,
26+
backgroundColor: Color(color).darken(0.5).fade(0.2).string(),
27+
}),
28+
color: "#fff",
29+
cursor: "pointer",
30+
"&:hover": hasIcon
31+
? {
32+
backgroundColor: Color(color).fade(0.5).string(),
33+
}
34+
: {
35+
backgroundColor: Color(color).darken(0.6).string(),
36+
},
37+
"& .icon": {
38+
color: color,
39+
width: 20,
40+
height: 20,
41+
},
42+
"& .stem": hasIcon
43+
? {}
44+
: {
45+
position: "absolute",
46+
left: -1,
47+
bottom: -2,
48+
width: 1,
49+
height: 2,
50+
backgroundColor: color,
51+
},
52+
}))
5553

5654
export const TimeStamp = ({ left, color, label, onClick, onRemove }) => {
5755
const [toolMode] = useToolMode()

src/components/Toolbar/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ const Container = styled("div")(({ themeColors }) => ({
4141
},
4242
}))
4343

44-
const getSelectFieldStyles = (themeColors, timestamp) => ({
45-
control: (styles, state) => ({
44+
const getSelectFieldStyles = (themeColors) => ({
45+
control: (styles) => ({
4646
...styles,
4747
border: `1px solid ${
4848
themeColors.dark ? "rgba(255,255,255,0.5)" : "rgba(0,0,0,0.5)"

0 commit comments

Comments
 (0)