Skip to content

Commit 3877aa9

Browse files
authored
Remove prop-types from many packages (#2758)
1 parent 518988f commit 3877aa9

File tree

72 files changed

+47
-1924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+47
-1924
lines changed

.changeset/rotten-pots-breathe.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"victory": minor
3+
"victory-area": minor
4+
"victory-axis": minor
5+
"victory-bar": minor
6+
"victory-box-plot": minor
7+
"victory-brush-container": minor
8+
"victory-brush-line": minor
9+
"victory-candlestick": minor
10+
"victory-canvas": minor
11+
"victory-chart": minor
12+
"victory-core": minor
13+
"victory-cursor-container": minor
14+
"victory-errorbar": minor
15+
"victory-group": minor
16+
"victory-histogram": minor
17+
"victory-legend": minor
18+
"victory-line": minor
19+
"victory-native": minor
20+
"victory-pie": minor
21+
"victory-polar-axis": minor
22+
"victory-scatter": minor
23+
"victory-selection-container": minor
24+
"victory-shared-events": minor
25+
"victory-stack": minor
26+
"victory-tooltip": minor
27+
"victory-voronoi": minor
28+
"victory-voronoi-container": minor
29+
"victory-zoom-container": minor
30+
---
31+
32+
Remove prop-types definitions and dependency

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ module.exports = {
6767
"no-undef": "off",
6868
"max-nested-callbacks": "off",
6969
"@typescript-eslint/no-empty-function": "off",
70-
"react/prop-types": "off",
7170
},
7271
},
7372
{
@@ -86,6 +85,7 @@ module.exports = {
8685
"plugin:@typescript-eslint/recommended-requiring-type-checking",
8786
],
8887
rules: {
88+
"react/prop-types": "off",
8989
"no-use-before-define": "off",
9090
"valid-jsdoc": "off",
9191
"@typescript-eslint/no-use-before-define": [

docs/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"fuse.js": "^3.2.1",
2929
"lodash": "^4.17.19",
3030
"prismjs": "^1.15.0",
31-
"prop-types": "^15.8.1",
3231
"react": "^16.8.0",
3332
"react-cool-inview": "^0.5.14",
3433
"react-copy-to-clipboard": "^5.0.2",

packages/victory-area/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"license": "MIT",
2222
"dependencies": {
2323
"lodash": "^4.17.19",
24-
"prop-types": "^15.8.1",
2524
"victory-core": "^36.8.6",
2625
"victory-vendor": "^36.8.6"
2726
},

packages/victory-area/src/area.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
22
import React from "react";
3-
import PropTypes from "prop-types";
43
import * as d3Shape from "victory-vendor/d3-shape";
54
import {
65
Helpers,
7-
CommonProps,
86
Path,
97
UserProps,
108
VictoryCommonPrimitiveProps,
@@ -176,13 +174,6 @@ export const Area: React.FC<AreaProps> = (initialProps) => {
176174
: area;
177175
};
178176

179-
Area.propTypes = {
180-
...CommonProps.primitiveProps,
181-
groupComponent: PropTypes.element,
182-
interpolation: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
183-
pathComponent: PropTypes.element,
184-
};
185-
186177
export interface AreaProps extends VictoryCommonPrimitiveProps {
187178
horizontal?: VictoryCommonThemeProps["horizontal"];
188179
groupComponent?: React.ReactElement;

packages/victory-area/src/victory-area.tsx

-27
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import PropTypes from "prop-types";
21
import React from "react";
32
import { getBaseProps } from "./helper-methods";
43
import { Area } from "./area";
54
import {
6-
PropTypes as CustomPropTypes,
75
Helpers,
86
VictoryLabel,
97
VictoryContainer,
10-
CommonProps,
118
DefaultTransitions,
129
VictoryClipContainer,
1310
addEvents,
@@ -71,30 +68,6 @@ class VictoryAreaBase extends React.Component<VictoryAreaProps> {
7168
"width",
7269
];
7370

74-
static propTypes = {
75-
...CommonProps.baseProps,
76-
...CommonProps.dataProps,
77-
interpolation: PropTypes.oneOfType([
78-
PropTypes.oneOf([
79-
"basis",
80-
"cardinal",
81-
"catmullRom",
82-
"linear",
83-
"monotoneX",
84-
"monotoneY",
85-
"natural",
86-
"step",
87-
"stepAfter",
88-
"stepBefore",
89-
]),
90-
PropTypes.func,
91-
]),
92-
label: CustomPropTypes.deprecated(
93-
PropTypes.string,
94-
"Use `labels` instead for individual data labels",
95-
),
96-
};
97-
9871
static defaultProps: VictoryAreaProps = {
9972
containerComponent: <VictoryContainer />,
10073
dataComponent: <Area />,

packages/victory-axis/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"license": "MIT",
2222
"dependencies": {
2323
"lodash": "^4.17.19",
24-
"prop-types": "^15.8.1",
2524
"victory-core": "^36.8.6"
2625
},
2726
"peerDependencies": {

packages/victory-axis/src/victory-axis.tsx

-72
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import PropTypes from "prop-types";
21
import React from "react";
32
import { isEmpty } from "lodash";
43
import {
5-
PropTypes as CustomPropTypes,
64
VictoryLabel,
7-
CommonProps,
85
VictoryContainer,
96
VictoryTheme,
107
LineSegment,
@@ -90,75 +87,6 @@ class VictoryAxisBase extends React.Component<VictoryAxisProps> {
9087
},
9188
};
9289

93-
static propTypes = {
94-
...CommonProps.baseProps,
95-
axisComponent: PropTypes.element,
96-
axisLabelComponent: PropTypes.element,
97-
axisValue: PropTypes.oneOfType([
98-
PropTypes.number,
99-
PropTypes.string,
100-
PropTypes.object,
101-
]),
102-
categories: PropTypes.oneOfType([
103-
PropTypes.arrayOf(PropTypes.string),
104-
PropTypes.shape({
105-
x: PropTypes.arrayOf(PropTypes.string),
106-
y: PropTypes.arrayOf(PropTypes.string),
107-
}),
108-
]),
109-
crossAxis: PropTypes.bool,
110-
dependentAxis: PropTypes.bool,
111-
events: PropTypes.arrayOf(
112-
PropTypes.shape({
113-
target: PropTypes.oneOf([
114-
"axis",
115-
"axisLabel",
116-
"grid",
117-
"ticks",
118-
"tickLabels",
119-
]),
120-
eventKey: PropTypes.oneOfType([
121-
PropTypes.array,
122-
CustomPropTypes.allOfType([
123-
CustomPropTypes.integer,
124-
CustomPropTypes.nonNegative,
125-
]),
126-
PropTypes.string,
127-
]),
128-
eventHandlers: PropTypes.object,
129-
}),
130-
),
131-
fixLabelOverlap: PropTypes.bool,
132-
gridComponent: PropTypes.element,
133-
groupComponent: PropTypes.element,
134-
invertAxis: PropTypes.bool,
135-
label: PropTypes.any,
136-
offsetX: PropTypes.number,
137-
offsetY: PropTypes.number,
138-
orientation: PropTypes.oneOf(["top", "bottom", "left", "right"]),
139-
origin: PropTypes.shape({ x: PropTypes.number, y: PropTypes.number }),
140-
stringMap: PropTypes.object,
141-
style: PropTypes.shape({
142-
parent: PropTypes.object,
143-
axis: PropTypes.object,
144-
axisLabel: PropTypes.object,
145-
grid: PropTypes.object,
146-
ticks: PropTypes.object,
147-
tickLabels: PropTypes.object,
148-
}),
149-
tickComponent: PropTypes.element,
150-
tickCount: CustomPropTypes.allOfType([
151-
CustomPropTypes.integer,
152-
CustomPropTypes.greaterThanZero,
153-
]),
154-
tickFormat: PropTypes.oneOfType([
155-
PropTypes.func,
156-
CustomPropTypes.homogeneousArray,
157-
]),
158-
tickLabelComponent: PropTypes.element,
159-
tickValues: CustomPropTypes.homogeneousArray,
160-
};
161-
16290
static defaultProps = {
16391
axisComponent: <LineSegment />,
16492
axisLabelComponent: <VictoryLabel />,

packages/victory-bar/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"license": "MIT",
2222
"dependencies": {
2323
"lodash": "^4.17.19",
24-
"prop-types": "^15.8.1",
2524
"victory-core": "^36.8.6",
2625
"victory-vendor": "^36.8.6"
2726
},

packages/victory-bar/src/bar.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/prop-types */
21
import React, { forwardRef } from "react";
32
import {
43
Helpers,

packages/victory-box-plot/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"license": "MIT",
2222
"dependencies": {
2323
"lodash": "^4.17.19",
24-
"prop-types": "^15.8.1",
2524
"victory-core": "^36.8.6",
2625
"victory-vendor": "^36.8.6"
2726
},

0 commit comments

Comments
 (0)