Skip to content

Commit f907d53

Browse files
install babel-plugin-transform-react-
remove-prop-types
1 parent b07a02b commit f907d53

File tree

6 files changed

+28
-16
lines changed

6 files changed

+28
-16
lines changed

.babelrc.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,25 @@ const output = process.env.BABEL_OUTPUT;
44
const requirePolyfills = process.env.INCLUDE_POLYFILLS;
55
const modules = output == null ? false : output;
66
const options = {
7-
presets: [['@babel/env', { loose: true, modules }], '@babel/react'],
8-
plugins: [
9-
'@babel/plugin-transform-react-jsx'
7+
presets: [['@babel/env', {loose: true, modules}], '@babel/react'],
8+
plugins: [
9+
'@babel/plugin-transform-react-jsx',
10+
[
11+
'transform-react-remove-prop-types',
12+
{
13+
mode: 'remove',
14+
ignoreFilenames: ['node_modules'],
15+
},
1016
],
11-
env: {
12-
test: { // extra configuration for process.env.NODE_ENV === 'test'
13-
presets: ['@babel/env'] // overwrite env-config from above with transpiled module syntax
14-
}
15-
}
17+
],
18+
env: {
19+
test: {
20+
// extra configuration for process.env.NODE_ENV === 'test'
21+
presets: ['@babel/env'], // overwrite env-config from above with transpiled module syntax
22+
},
23+
},
1624
};
1725
if (requirePolyfills) {
18-
options.plugins.push([
19-
'@babel/plugin-transform-runtime',
20-
{ corejs: 3 }
21-
]);
26+
options.plugins.push(['@babel/plugin-transform-runtime', {corejs: 3}]);
2227
}
23-
module.exports = options;
28+
module.exports = options;

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@rollup/plugin-commonjs": "^18.0.0",
4848
"@rollup/plugin-node-resolve": "^11.2.1",
4949
"babel-loader": "^8.1.0",
50+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
5051
"cross-env": "^7.0.3",
5152
"css-loader": "^4.3.0",
5253
"eslint": "^7.27.0",

src/panel/panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const PanelComponent = function PanelComponent(props) {
1515
</div>
1616
);
1717
};
18-
PanelComponent.propTypes = {
18+
PanelComponent.propTypes /* remove-proptypes */ = {
1919
id: PropTypes.string,
2020
selectedTabID: PropTypes.string,
2121
};

src/tab/defaulTabInner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const DefaulTabInner = function DefaulTabInner(props) {
88
</button>
99
);
1010
};
11-
DefaulTabInner.propTypes = {
11+
DefaulTabInner.propTypes /* remove-proptypes */ = {
1212
tabProps: PropTypes.object,
1313
children: PropTypes.node,
1414
iconProps: PropTypes.object,

src/tab/tab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const TabComponent = function TabComponent(props) {
2323
</li>
2424
);
2525
};
26-
TabComponent.propTypes = {
26+
TabComponent.propTypes /* remove-proptypes */ = {
2727
id: PropTypes.string,
2828
selectedTabID: PropTypes.string,
2929
};

0 commit comments

Comments
 (0)