Skip to content

Commit

Permalink
Remove prop-types (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
anajavi authored Apr 4, 2022
1 parent bc85ad5 commit f7661da
Show file tree
Hide file tree
Showing 41 changed files with 67 additions and 305 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
"rules": {
"no-unused-vars": ["error", { "ignoreRestSiblings": true }],
"react/prop-types": "warn",
"react/prop-types": "off",
"prefer-object-spread": "warn",
"react-hooks/rules-of-hooks": "error",
"react/jsx-no-constructed-context-values": "error"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ npm install --save react-jsx-highcharts
# or react-jsx-highmaps

# And the peer dependencies
npm install --save react react-dom prop-types highcharts@^9.0.0
npm install --save react react-dom highcharts@^9.0.0
```

## Licensing
Expand Down
3 changes: 0 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ let config = {
'@babel/react'
]
};
if (ENV !== 'test') {
config.plugins.push('transform-react-remove-prop-types');
}

module.exports = config;
113 changes: 54 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@testing-library/react": "^13.0.0",
"@types/react": "^17.0.40",
"babel-loader": "^8.2.3",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"cross-env": "^7.0.3",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -31,7 +30,6 @@
"highcharts": "^10.0.0",
"jest": "^27.5.1",
"prettier": "^2.6.0",
"prop-types": "^15.8.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-test-renderer": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-jsx-highcharts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ React JSX Highcharts also enables you to write your _own_ Highcharts components,

You'll need the peer dependencies too

`npm install --save react react-dom prop-types highcharts@^9.0.0`
`npm install --save react react-dom highcharts@^9.0.0`

## Licensing

Expand Down
3 changes: 1 addition & 2 deletions packages/react-jsx-highcharts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
"peerDependencies": {
"highcharts": "^8.0.0 || ^9.0.0 || ^10.0.0",
"react": "^16.8.6 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0",
"prop-types": "^15.0.0"
"react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0"
},
"browserslist": [
"ie >= 11"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useRef, useEffect, memo } from 'react';
import PropTypes from 'prop-types';
import { v4 as uuid } from 'uuid';
import { logModuleErrorMessage } from '../../utils/warnings';
import useChart from '../UseChart';
Expand Down Expand Up @@ -38,10 +37,6 @@ const Annotation = memo(props => {
return null;
});

Annotation.propTypes = {
id: PropTypes.oneOfType([PropTypes.string, PropTypes.func])
};

Annotation.displayName = 'Annotation';

export default Annotation;
9 changes: 0 additions & 9 deletions packages/react-jsx-highcharts/src/components/Axis/Axis.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import * as React from 'react';
import { useEffect, useState, useRef } from 'react';
import PropTypes from 'prop-types';
import { v4 as uuid } from 'uuid';
import AxisContext from '../AxisContext';
import { getNonEventHandlerProps, getEventsConfig } from '../../utils/events';
import { validAxisTypes } from '../../utils/propTypeValidators';
import useModifiedProps from '../UseModifiedProps';
import useChart from '../UseChart';
import createProvidedAxis from './createProvidedAxis';
Expand Down Expand Up @@ -91,11 +89,4 @@ const createAxis = (chart, props, dynamicAxis) => {
return axis;
};

Axis.propTypes = {
type: validAxisTypes,
id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
children: PropTypes.node,
dynamicAxis: PropTypes.bool
};

export default Axis;
Loading

0 comments on commit f7661da

Please sign in to comment.