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

Appearance settings

Commit 0fbe35e

Browse filesBrowse files
authored
Improve error range for vue/max-props (#2532)
1 parent 705d262 commit 0fbe35e
Copy full SHA for 0fbe35e

File tree

2 files changed

+7
-4
lines changed
Filter options

2 files changed

+7
-4
lines changed

‎lib/rules/max-props.js

Copy file name to clipboardExpand all lines: lib/rules/max-props.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343
function checkMaxNumberOfProps(props) {
4444
if (props.length > option.maxProps && props[0].node) {
4545
context.report({
46-
node: props[0].node,
46+
node: props[0].node.parent,
4747
messageId: 'tooManyProps',
4848
data: {
4949
propCount: props.length,

‎tests/lib/rules/max-props.js

Copy file name to clipboardExpand all lines: tests/lib/rules/max-props.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ tester.run('max-props', rule, {
113113
errors: [
114114
{
115115
message: 'Component has too many props (2). Maximum allowed is 1.',
116-
line: 3
116+
line: 3,
117+
endLine: 3
117118
}
118119
]
119120
},
@@ -133,7 +134,8 @@ tester.run('max-props', rule, {
133134
errors: [
134135
{
135136
message: 'Component has too many props (2). Maximum allowed is 1.',
136-
line: 5
137+
line: 4,
138+
endLine: 7
137139
}
138140
]
139141
},
@@ -154,7 +156,8 @@ tester.run('max-props', rule, {
154156
errors: [
155157
{
156158
message: 'Component has too many props (3). Maximum allowed is 2.',
157-
line: 3
159+
line: 3,
160+
endLine: 3
158161
}
159162
]
160163
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.