You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using babel-eslint parser, this piece of invalid code (notice the colon instead of an equals sign): static propTypes: { showCompletedReleases: PropTypes.bool.isRequired }
will crash the linter with this error:
[...]/node_modules/eslint-plugin-react/lib/rules/prop-types.js:165
switch (propTypes.type) {
^
TypeError: Cannot read property 'type' of null
at markPropTypesAsDeclared (/Users/zuse/Projects/pb-frontend/node_modules/eslint-plugin-react/lib/rules/prop-types.js:165:22)
at EventEmitter.ClassProperty (/Users/zuse/Projects/pb-frontend/node_modules/eslint-plugin-react/lib/rules/prop-types.js:220:7)
at EventEmitter.emit (events.js:107:17)
at Controller.controller.traverse.enter (/Users/zuse/Projects/pb-frontend/node_modules/eslint/lib/eslint.js:725:25)
at Controller.__execute (/Users/zuse/Projects/pb-frontend/node_modules/eslint/node_modules/estraverse/estraverse.js:393:31)
at Controller.traverse (/Users/zuse/Projects/pb-frontend/node_modules/eslint/node_modules/estraverse/estraverse.js:491:28)
at EventEmitter.module.exports.api.verify (/Users/zuse/Projects/pb-frontend/node_modules/eslint/lib/eslint.js:718:24)
at processFile (/Users/zuse/Projects/pb-frontend/node_modules/eslint/lib/cli-engine.js:197:27)
at /Users/zuse/Projects/pb-frontend/node_modules/eslint/lib/cli-engine.js:332:26
at /Users/zuse/Projects/pb-frontend/node_modules/eslint/lib/util/traverse.js:61:17
The text was updated successfully, but these errors were encountered:
Babel seems to accept the code but do not output the propTypes key in the compiled source, resulting in missing propTypes definition.
I've updated the rule to ignore the propTypes definition in this case, so you'll get an "propTypes missing" error if your propTypes definition is invalid.
Using
babel-eslint
parser, this piece of invalid code (notice the colon instead of an equals sign):static propTypes: { showCompletedReleases: PropTypes.bool.isRequired }
will crash the linter with this error:
The text was updated successfully, but these errors were encountered: