Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
This issue was initially reported here:eslint/typescript-eslint-parser#512
What version of TypeScript are you using?
3.0.3
What version oftypescript-eslint-parser
are you using?
18.0.0
What code were you trying to parse?
importReactfrom'react';importstyledfrom'styled-components';importCardContentfrom'@material-ui/core/CardContent';importTextFieldfrom'../../../components/TextField';importTitlefrom'../../../components/Title';importButtonfrom'../../../components/Button';constSendTransaction=props=>(<Content><Title>SendPayment</Title><Section><TextFieldname="receiveraddress"label="Receiver´s Address"value={props.receiveraddress}type="text"onChange={props.onChange}/></Section><Section><TextFieldname="receivername"label="Receiver´s Name (Optional)"value={props.receivername}type="text"onChange={props.onChange}/></Section><Section><TextFieldname="amount"label="Amount to Send"value={props.amount}type="text"{...props}/></Section><Section><ButtononClick={props.makeTransaction}text="Make Payment"/></Section></Content>);constContent=styled(CardContent)``;constSection=styled.div` padding: 10px;`;exportdefaultSendTransaction;
What did you expect to happen?
I should get errors forreact/prop-types
.
What happened?
No errors.
.eslintrc.json
Tried 2:
{ "parser": "typescript-eslint-parser", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", "ecmaFeatures": { "jsx": true } }, "plugins": ["react"], "rules": { "react/prop-types": [1, { "ignore": ["children"] }] }}
and:
{ "env": { "es6": true }, "parser": "typescript-eslint-parser", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", "ecmaFeatures": { "jsx": true, "spread": true, "experimentalObjectRestSpread": true } }, "ecmaFeatures": { "spread": true, "experimentalObjectRestSpread": true }, "plugins": ["react"], "rules": { "react/prop-types": [1, { "ignore": ["children"] }] }}
Reason
It is due to the{...props}
. As soon as I remove that, I get thereact/prop-types
errors.