Skip to content

Commit 0dff879

Browse files
committed
feat(controls): fix linting issues
1 parent ac64225 commit 0dff879

File tree

7 files changed

+13
-19
lines changed

7 files changed

+13
-19
lines changed

conf/rollup.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ const common = {
3636
|| id.indexOf('d3') === 0
3737
|| id.indexOf('@nivo') === 0
3838
|| id.indexOf('lodash') === 0
39-
|| id.indexOf('@react-spring') === 0,
39+
|| id.indexOf('@react-spring') === 0
40+
|| id.indexOf('styled-components') === 0
41+
|| id.indexOf('dedent-js') === 0
4042
}
4143

4244
const commonPlugins = [

packages/bar/src/BarCanvas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ const InnerBarCanvas = <D extends BarDatum>({
263263
canvasEl.current.width = outerWidth * pixelRatio
264264
canvasEl.current.height = outerHeight * pixelRatio
265265

266-
const ctx = canvasEl.current?.getContext('2d')!
266+
const ctx = canvasEl.current.getContext('2d')!
267267

268268
ctx.scale(pixelRatio, pixelRatio)
269269

packages/controls/README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
<a href="https://nivo.rocks"><img alt="nivo" src="https://raw.githubusercontent.com/plouc/nivo/master/nivo.png" width="216" height="68"/></a>
22

3-
# `@nivo/chord`
3+
# `@nivo/controls`
44

5-
[![version](https://img.shields.io/npm/v/@nivo/chord?style=for-the-badge)](https://www.npmjs.com/package/@nivo/chord)
6-
[![downloads](https://img.shields.io/npm/dm/@nivo/chord?style=for-the-badge)](https://www.npmjs.com/package/@nivo/chord)
5+
[![version](https://img.shields.io/npm/v/@nivo/controls?style=for-the-badge)](https://www.npmjs.com/package/@nivo/controls)
6+
[![downloads](https://img.shields.io/npm/dm/@nivo/controls?style=for-the-badge)](https://www.npmjs.com/package/@nivo/controls)
77

8-
## Chord
9-
10-
[documentation](http://nivo.rocks/chord)
11-
12-
![Chord](https://raw.githubusercontent.com/plouc/nivo/master/website/src/assets/captures/chord.png)
13-
14-
## ChordCanvas
15-
16-
[documentation](http://nivo.rocks/chord/canvas)
17-
18-
![ChordCanvas](https://raw.githubusercontent.com/plouc/nivo/master/website/src/assets/captures/chord-canvas.png)
8+
This package is currently in development and is mostly for internal use for the nivo website.
9+
It contains a set of components that are used to create the controls for the nivo charts.

packages/controls/src/ControlGroup/ControlGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const ControlSwitcher = memo(
140140

141141
default:
142142
throw new Error(
143-
// @ts-expect-error
143+
// @ts-expect-error this could happen at runtime
144144
`invalid control type: ${controlConfig!.type} for property: ${property.name}`
145145
)
146146
}

packages/controls/src/ObjectControl/ObjectControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const ObjectControl = memo(({ property, context, value, onChange }: Objec
2424
...prop,
2525
group,
2626
})),
27-
[props]
27+
[props, group]
2828
)
2929

3030
const newContext = {

packages/controls/src/chrome/ControlHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const getDefaultValue = (value: any) => {
2424

2525
return <span>[{elements}]</span>
2626
} else if (isString(value)) {
27-
return <code className="code-string">'{value}'</code>
27+
return <code className="code-string">&lsquo;{value}&rsquo;</code>
2828
} else if (isNumber(value)) {
2929
return <code className="code-number">{value}</code>
3030
} else if (isBoolean(value)) {

packages/controls/src/chrome/Switch.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const Switch = memo(({ id, value, onChange, colors = {} }: SwitchProps) =
2727
onChange={handleChange}
2828
colors={colors}
2929
/>
30+
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
3031
<label htmlFor={`${id}.switch`} />
3132
</Wrapper>
3233
)

0 commit comments

Comments
 (0)