[New] 'destructuring-assigment' : add 'useContext' rule in SFC#2787
[New] 'destructuring-assigment' : add 'useContext' rule in SFC#2787ed-jinyoung-park wants to merge 1 commit intojsx-eslint:masterfrom
Conversation
| }, { | ||
| code: `const MyComponent = (props, { color }) => ( | ||
| <div id={props.id} className={props.className} /> | ||
| );`, | ||
| options: ['never'], | ||
| errors: [ | ||
| {message: 'Must never use destructuring context assignment in SFC argument'} | ||
| ] |
There was a problem hiding this comment.
why is this test changed? this implies it's a breaking change.
There was a problem hiding this comment.
i think that case is legacy context assignment which is not used in current react version.
sorry for change without any comments.
There was a problem hiding this comment.
This plugin supports all react versions; nothing can be removed.
There was a problem hiding this comment.
i'm sorry. actually i want to ask about that. my mistake. then should I edit and make new PR?
plus, const destructuringContext = node.params && node.params[1] && node.params[1].type === 'ObjectPattern';should be added in function handleStatelessComponent(node) right?
There was a problem hiding this comment.
@ljharb
i did revive test cases which i deleted and rules associated. please check again
a2e350c to
635c617
Compare
59af733 to
865ed16
Compare
069314a to
181c68f
Compare
resolve issue #2309
delete rule about variable happens to be named
contextset rule on
useContextwithoptions: alwaysandoptions: nevercontextSetto detect any renamed variable that is being assigned byuseContext