Skip to content

Commit

Permalink
Remove prop-types from many packages (#2758)
Browse files Browse the repository at this point in the history
  • Loading branch information
KenanYusuf authored Feb 5, 2024
1 parent 518988f commit 3877aa9
Show file tree
Hide file tree
Showing 72 changed files with 47 additions and 1,924 deletions.
32 changes: 32 additions & 0 deletions .changeset/rotten-pots-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
"victory": minor
"victory-area": minor
"victory-axis": minor
"victory-bar": minor
"victory-box-plot": minor
"victory-brush-container": minor
"victory-brush-line": minor
"victory-candlestick": minor
"victory-canvas": minor
"victory-chart": minor
"victory-core": minor
"victory-cursor-container": minor
"victory-errorbar": minor
"victory-group": minor
"victory-histogram": minor
"victory-legend": minor
"victory-line": minor
"victory-native": minor
"victory-pie": minor
"victory-polar-axis": minor
"victory-scatter": minor
"victory-selection-container": minor
"victory-shared-events": minor
"victory-stack": minor
"victory-tooltip": minor
"victory-voronoi": minor
"victory-voronoi-container": minor
"victory-zoom-container": minor
---

Remove prop-types definitions and dependency
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ module.exports = {
"no-undef": "off",
"max-nested-callbacks": "off",
"@typescript-eslint/no-empty-function": "off",
"react/prop-types": "off",
},
},
{
Expand All @@ -86,6 +85,7 @@ module.exports = {
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: {
"react/prop-types": "off",
"no-use-before-define": "off",
"valid-jsdoc": "off",
"@typescript-eslint/no-use-before-define": [
Expand Down
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"fuse.js": "^3.2.1",
"lodash": "^4.17.19",
"prismjs": "^1.15.0",
"prop-types": "^15.8.1",
"react": "^16.8.0",
"react-cool-inview": "^0.5.14",
"react-copy-to-clipboard": "^5.0.2",
Expand Down
1 change: 0 additions & 1 deletion packages/victory-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"license": "MIT",
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.6",
"victory-vendor": "^36.8.6"
},
Expand Down
9 changes: 0 additions & 9 deletions packages/victory-area/src/area.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
import React from "react";
import PropTypes from "prop-types";
import * as d3Shape from "victory-vendor/d3-shape";
import {
Helpers,
CommonProps,
Path,
UserProps,
VictoryCommonPrimitiveProps,
Expand Down Expand Up @@ -176,13 +174,6 @@ export const Area: React.FC<AreaProps> = (initialProps) => {
: area;
};

Area.propTypes = {
...CommonProps.primitiveProps,
groupComponent: PropTypes.element,
interpolation: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
pathComponent: PropTypes.element,
};

export interface AreaProps extends VictoryCommonPrimitiveProps {
horizontal?: VictoryCommonThemeProps["horizontal"];
groupComponent?: React.ReactElement;
Expand Down
27 changes: 0 additions & 27 deletions packages/victory-area/src/victory-area.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import PropTypes from "prop-types";
import React from "react";
import { getBaseProps } from "./helper-methods";
import { Area } from "./area";
import {
PropTypes as CustomPropTypes,
Helpers,
VictoryLabel,
VictoryContainer,
CommonProps,
DefaultTransitions,
VictoryClipContainer,
addEvents,
Expand Down Expand Up @@ -71,30 +68,6 @@ class VictoryAreaBase extends React.Component<VictoryAreaProps> {
"width",
];

static propTypes = {
...CommonProps.baseProps,
...CommonProps.dataProps,
interpolation: PropTypes.oneOfType([
PropTypes.oneOf([
"basis",
"cardinal",
"catmullRom",
"linear",
"monotoneX",
"monotoneY",
"natural",
"step",
"stepAfter",
"stepBefore",
]),
PropTypes.func,
]),
label: CustomPropTypes.deprecated(
PropTypes.string,
"Use `labels` instead for individual data labels",
),
};

static defaultProps: VictoryAreaProps = {
containerComponent: <VictoryContainer />,
dataComponent: <Area />,
Expand Down
1 change: 0 additions & 1 deletion packages/victory-axis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"license": "MIT",
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.6"
},
"peerDependencies": {
Expand Down
72 changes: 0 additions & 72 deletions packages/victory-axis/src/victory-axis.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import PropTypes from "prop-types";
import React from "react";
import { isEmpty } from "lodash";
import {
PropTypes as CustomPropTypes,
VictoryLabel,
CommonProps,
VictoryContainer,
VictoryTheme,
LineSegment,
Expand Down Expand Up @@ -90,75 +87,6 @@ class VictoryAxisBase extends React.Component<VictoryAxisProps> {
},
};

static propTypes = {
...CommonProps.baseProps,
axisComponent: PropTypes.element,
axisLabelComponent: PropTypes.element,
axisValue: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
PropTypes.object,
]),
categories: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.string),
PropTypes.shape({
x: PropTypes.arrayOf(PropTypes.string),
y: PropTypes.arrayOf(PropTypes.string),
}),
]),
crossAxis: PropTypes.bool,
dependentAxis: PropTypes.bool,
events: PropTypes.arrayOf(
PropTypes.shape({
target: PropTypes.oneOf([
"axis",
"axisLabel",
"grid",
"ticks",
"tickLabels",
]),
eventKey: PropTypes.oneOfType([
PropTypes.array,
CustomPropTypes.allOfType([
CustomPropTypes.integer,
CustomPropTypes.nonNegative,
]),
PropTypes.string,
]),
eventHandlers: PropTypes.object,
}),
),
fixLabelOverlap: PropTypes.bool,
gridComponent: PropTypes.element,
groupComponent: PropTypes.element,
invertAxis: PropTypes.bool,
label: PropTypes.any,
offsetX: PropTypes.number,
offsetY: PropTypes.number,
orientation: PropTypes.oneOf(["top", "bottom", "left", "right"]),
origin: PropTypes.shape({ x: PropTypes.number, y: PropTypes.number }),
stringMap: PropTypes.object,
style: PropTypes.shape({
parent: PropTypes.object,
axis: PropTypes.object,
axisLabel: PropTypes.object,
grid: PropTypes.object,
ticks: PropTypes.object,
tickLabels: PropTypes.object,
}),
tickComponent: PropTypes.element,
tickCount: CustomPropTypes.allOfType([
CustomPropTypes.integer,
CustomPropTypes.greaterThanZero,
]),
tickFormat: PropTypes.oneOfType([
PropTypes.func,
CustomPropTypes.homogeneousArray,
]),
tickLabelComponent: PropTypes.element,
tickValues: CustomPropTypes.homogeneousArray,
};

static defaultProps = {
axisComponent: <LineSegment />,
axisLabelComponent: <VictoryLabel />,
Expand Down
1 change: 0 additions & 1 deletion packages/victory-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"license": "MIT",
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.6",
"victory-vendor": "^36.8.6"
},
Expand Down
1 change: 0 additions & 1 deletion packages/victory-bar/src/bar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/prop-types */
import React, { forwardRef } from "react";
import {
Helpers,
Expand Down
1 change: 0 additions & 1 deletion packages/victory-box-plot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"license": "MIT",
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.6",
"victory-vendor": "^36.8.6"
},
Expand Down
Loading

0 comments on commit 3877aa9

Please sign in to comment.