Skip to content

Commit

Permalink
lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Williams committed Nov 11, 2019
1 parent 115df87 commit ebffcf3
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 23 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ Lots coming soon, check out the [roadmap](./ROADMAP.md).
## Development

[Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) are used to manage dependencies and build config across packages in the umbrella `vx` monorepo, and [lerna](https://github.com/lerna/lerna/) is used to manage versioning.
[Yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) are used to manage dependencies and
build config across packages in the umbrella `vx` monorepo, and
[lerna](https://github.com/lerna/lerna/) is used to manage versioning.

```
vx/
Expand Down Expand Up @@ -308,14 +310,14 @@ yarn
yarn build
```

Upon modification of a signle `package` you can run `yarn build-one --workspaces=@vx/package` from
the `vx` monorepo root to re-build the package with your changes. You can use the local
[`next.js`](https://nextjs.org) dev server within `packages/vx-demo` to view and iterate on your
changes in the gallery. From the `packages/vx-demo` folder run `yarn dev` to start the next server
which (if correctly sym-linked) will also watch for changes you make to other packages (upon
Upon modification of a signle `package` you can run `yarn build-one --workspaces=@vx/package` from
the `vx` monorepo root to re-build the package with your changes. You can use the local
[`next.js`](https://nextjs.org) dev server within `packages/vx-demo` to view and iterate on your
changes in the gallery. From the `packages/vx-demo` folder run `yarn dev` to start the next server
which (if correctly sym-linked) will also watch for changes you make to other packages (upon
re-building them).

`vx` uses [`@airbnb/nimbus`](https://github.com/airbnb/nimbus) to generate build configuration for
`vx` uses [`@airbnb/nimbus`](https://github.com/airbnb/nimbus) to generate build configuration for
`eslint`, `prettier`, `jest`, `babel`, and `typescript`.

:v:
Expand Down
4 changes: 2 additions & 2 deletions packages/vx-chord/src/Ribbon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export default function Ribbon({
className,
...restProps
}: RibbonProps & Omit<React.SVGProps<SVGPathElement>, keyof RibbonProps>) {
const ribbon = d3ribbon<any, Chord, ChordSubgroup>();
const ribbon = d3ribbon<unknown, Chord, ChordSubgroup>();
if (source) ribbon.source(source);
if (target) ribbon.target(target);
if (radius) setNumberOrNumberAccessor(ribbon.radius, radius);
if (startAngle) setNumberOrNumberAccessor(ribbon.startAngle, startAngle);
if (endAngle) setNumberOrNumberAccessor(ribbon.endAngle, endAngle);
const path = ribbon(chord) as any;
const path = ribbon(chord) as unknown;
if (children) return <>{children({ path })}</>;

return <path className={cx('vx-ribbon', className)} d={path} {...restProps} />;
Expand Down
2 changes: 1 addition & 1 deletion packages/vx-chord/test/Ribbon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('<Ribbon />', () => {
const children = jest.fn(() => 'test');
shallow(<Ribbon chord={chords[0]} children={children} />);
// we don't know type of the arguments
const args = (children.mock.calls[0] as any)[0];
const args = (children.mock.calls[0] as unknown)[0];
expect(children.mock.calls).toHaveLength(1);
expect(args.path).toBeDefined();
});
Expand Down
6 changes: 3 additions & 3 deletions packages/vx-geo/src/projections/Projection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ export type ProjectionProps<Datum extends GeoPermissibleObjects> = {
*/
fitExtent?: [
[[number, number], [number, number]],
any, // ExtendedFeature | ExtendedFeatureCollection | GeoGeometryObjects,
unknown, // ExtendedFeature | ExtendedFeatureCollection | GeoGeometryObjects,
];
/** Convenience prop for props.fitExtent where the top-left corner of the extent is [0, 0]. */
fitSize?: [
[number, number],
any, // ExtendedFeature | ExtendedFeatureCollection | GeoGeometryObjects
unknown, // ExtendedFeature | ExtendedFeatureCollection | GeoGeometryObjects
];
/** Hook to render anything at the centroid of a feature. */
centroid?: (centroid: [number, number], feature: ParsedFeature<Datum>) => React.ReactNode;
/** className to apply to feature path elements. */
className?: string;
/** Override render function which is passed the */
children?: (args: {
path: GeoPath<any, GeoPermissibleObjects>;
path: GeoPath<unknown, GeoPermissibleObjects>;
features: ParsedFeature<Datum>[];
}) => React.ReactNode;
/** Function invoked for each feature which returns a React.Ref to the projection path element for that feature. */
Expand Down
4 changes: 2 additions & 2 deletions packages/vx-heatmap/src/heatmaps/HeatmapCircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export default function HeatmapCircle<ColumnDatum, BinDatum>({
yScale,
colorScale = () => undefined,
opacityScale = () => 1,
bins = (column: any) => column && column.bins,
count = (cell: any) => cell && cell.count,
bins = (column: unknown) => column && column.bins,
count = (cell: unknown) => cell && cell.count,
children,
...restProps
}: HeatmapCircleProps<ColumnDatum, BinDatum> &
Expand Down
4 changes: 2 additions & 2 deletions packages/vx-heatmap/src/heatmaps/HeatmapRect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export default function HeatmapRect<ColumnDatum, BinDatum>({
yScale,
colorScale = () => undefined,
opacityScale = () => 1,
bins = (d: any) => d && d.bins,
count = (d: any) => d && d.count,
bins = (d: unknown) => d && d.bins,
count = (d: unknown) => d && d.count,
children,
...restProps
}: ComponentProps<ColumnDatum, BinDatum>) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vx-network/src/DefaultLink.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { LinkProvidedProps } from './types';

export default function DefaultLink({ link }: LinkProvidedProps<any>) {
export default function DefaultLink({ link }: LinkProvidedProps<unknown>) {
return link && link.source && link.target ? (
<line
x1={link.source.x}
Expand Down
4 changes: 2 additions & 2 deletions packages/vx-network/src/Nodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default function Nodes<Node>({
nodes = [],
nodeComponent = DefaultNode,
className,
x = (d: any) => (d && d.x) || 0,
y = (d: any) => (d && d.y) || 0,
x = (d: unknown) => (d && d.x) || 0,
y = (d: unknown) => (d && d.y) || 0,
}: NodeProps<Node>) {
return (
<>
Expand Down
4 changes: 2 additions & 2 deletions packages/vx-scale/src/scales/symlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { scaleSymlog } from 'd3-scale';

export type SymlogConfig = {
/** Sets the output values of the scale. */
range?: any[];
range?: unknown[];
/** Sets the input values of the scale. */
domain?: any[];
domain?: unknown[];
/** Sets the symlog constant to the specified number, defaults to 1. */
constant?: number;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/vx-scale/src/util/updateScale.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const has = Object.prototype.hasOwnProperty;

export default function updateScale(scale: any, { ...args }: any = {}) {
export default function updateScale(scale: unknown, { ...args }: unknown = {}) {
const nextScale = scale.copy();
Object.keys(args).forEach(key => {
if (has.call(nextScale, key)) nextScale[key](args[key]);
Expand Down

0 comments on commit ebffcf3

Please sign in to comment.