Skip to content

Commit

Permalink
Improve errors locations for prop-types
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed May 14, 2015
1 parent 70fef71 commit 33a8be0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module.exports = function(context) {
case 'direct':
usedPropTypes.push({
name: node.parent.property.name,
node: node
node: node.parent.property
});
break;
case 'destructuring':
Expand All @@ -139,7 +139,7 @@ module.exports = function(context) {
}
usedPropTypes.push({
name: properties[i].key.name,
node: node
node: properties[i]
});
}
break;
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ eslintTester.addRuleTest('lib/rules/prop-types', {
errors: [{
message: '\'name\' is missing in props validation',
line: 3,
column: 23,
type: 'MemberExpression'
column: 34,
type: 'Identifier'
}]
}, {
code: [
Expand All @@ -271,8 +271,8 @@ eslintTester.addRuleTest('lib/rules/prop-types', {
errors: [{
message: '\'name\' is missing in props validation for Hello',
line: 3,
column: 23,
type: 'MemberExpression'
column: 34,
type: 'Identifier'
}]
}, {
code: [
Expand Down

0 comments on commit 33a8be0

Please sign in to comment.