We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c107636 commit 754022cCopy full SHA for 754022c
lib/rules/prop-types.js
@@ -271,8 +271,11 @@ module.exports = {
271
*/
272
function getKeyValue(node) {
273
if (node.type === 'ObjectTypeProperty') {
274
- var tokens = context.getFirstTokens(node, 1);
275
- return tokens[0].value;
+ var tokens = context.getFirstTokens(node, 2);
+ return (tokens[0].value === '+' || tokens[0].value === '-'
276
+ ? tokens[1].value
277
+ : tokens[0].value
278
+ );
279
}
280
var key = node.key || node.argument;
281
return key.type === 'Identifier' ? key.name : key.value;
0 commit comments