Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Object spread in JSX causes lint errors to not show #17

Closed
Assignees
armano2
Labels
bugSomething isn't working
@JamesHenry

Description

@JamesHenry

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp