Skip to content

Commit

Permalink
style: fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
lzear committed Mar 25, 2023
1 parent 73e683a commit eeaad86
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion demo/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MyDocument extends Document {
sizes="16x16"
href="/favicon-16x16.png"
/>
<link rel="manifest" href="/manifest.json" />
{/*<link rel="manifest" href="/manifest.json" />*/}
<link
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;0,800;1,400&display=swap"
rel="stylesheet"
Expand Down
11 changes: 4 additions & 7 deletions demo/src/boxes-transition.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { a, TransitionFn, useTransition } from '@react-spring/web'
import { a, useTransition } from '@react-spring/web'
import type { TransitionFn } from '@react-spring/core'
import { useHover } from '@use-gesture/react'
import _ from 'lodash'
import { BoxMeta, BoxPosition, WithColor } from './ballots-ui'
Expand All @@ -15,11 +16,8 @@ type TrState = {

export const useBoxesTransition = (
boxes: (BoxMeta & BoxPosition & WithColor & { opacity?: number })[],
): TransitionFn<
BoxMeta & BoxPosition & WithColor & { opacity?: number },
TrState
> => {
return useTransition<
) =>
useTransition<
BoxMeta & BoxPosition & WithColor & { opacity?: number },
TrState
>(boxes, {
Expand Down Expand Up @@ -54,7 +52,6 @@ export const useBoxesTransition = (
// Using an array created by lodash.map
keys: _.map(boxes, 'key'),
})
}

export const renderBoxes = (
transitions: TransitionFn<
Expand Down
3 changes: 1 addition & 2 deletions demo/src/generate-ballots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const { groupBallots } = utils
const mergeDraw = <T>(initial: T[][], toAdd: T) => {
const idx = Math.floor(Math.random() * initial.length)

if (initial[idx]?.length) initial[idx] = [...initial[idx], toAdd]
else initial[idx] = [toAdd]
initial[idx] = initial[idx]?.length ? [...initial[idx], toAdd] : [toAdd]

return initial
}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/matrix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from './store/selectors'
import { Checkbox, Typography } from 'antd'
import { CandiTag } from './candidates'
import shallow from 'zustand/shallow'
import { shallow } from 'zustand/shallow'
import { utils } from 'votes'

export const MatrixComp: React.FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion demo/src/methods/borda/viz-borda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Button } from 'antd'
import * as d3 from 'd3'
import { hierarchy, treemap } from 'd3-hierarchy'
import { scaleBand } from 'd3-scale'
import shallow from 'zustand/shallow'
import { shallow } from 'zustand/shallow'
import {
selectBallots,
selectWidth,
Expand Down
4 changes: 2 additions & 2 deletions demo/src/react-ranker/ranker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const Ranker: React.FC<Props> = ({
bHeight={B_HEIGHT}
bGutter={B_GUTTER}
count={maxRank}
hovered={nextB !== null ? nextB * 2 + 1 : null}
hovered={nextB === null ? null : nextB * 2 + 1}
/>
<style jsx global>{`
.car {
Expand Down Expand Up @@ -271,7 +271,7 @@ const Ranker: React.FC<Props> = ({
padding-left: 8px;
text-transform: uppercase;
letter-spacing: -0.0142857em;
cursor: -webkit-grab;
cursor: grab;
user-select: none;
}
`}</style>
Expand Down
8 changes: 4 additions & 4 deletions demo/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ export const useStore = create<Store>()(
set(({ ballots }) => ({
ballots: ballots
.map((ballot) =>
ballot.id !== id
? ballot
: { ...ballot, weight: ballot.weight + diff },
ballot.id === id
? { ...ballot, weight: ballot.weight + diff }
: ballot,
)
.filter((ballot) => ballot.weight > 0)
.map((b, idx) => ({ ...b, idx })),
Expand All @@ -123,7 +123,7 @@ export const useStore = create<Store>()(
set(({ ballots }) => ({
ballots: mergeBallotsUtil(
ballots.map((ballot) =>
ballot.id !== id ? ballot : { ...ballot, ranking },
ballot.id === id ? { ...ballot, ranking } : ballot,
),
),
}))
Expand Down

0 comments on commit eeaad86

Please sign in to comment.