Skip to content

Commit e51589d

Browse files
authored
feat(max-len): improve error positions (#3066)
1 parent 45ba358 commit e51589d

3 files changed

Lines changed: 301 additions & 290 deletions

File tree

.changeset/hip-candles-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-vue": patch
3+
---
4+
5+
Improved error positions in `vue/max-len`

lib/rules/max-len.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,10 @@ module.exports = {
474474
if (lineLength > maxCommentLength) {
475475
context.report({
476476
node,
477-
loc: { line: lineNumber, column: 0 },
477+
loc: {
478+
start: { line: lineNumber, column: maxCommentLength },
479+
end: { line: lineNumber, column: lineLength }
480+
},
478481
messageId: 'maxComment',
479482
data: {
480483
lineLength,
@@ -485,7 +488,10 @@ module.exports = {
485488
} else if (lineLength > maxLength) {
486489
context.report({
487490
node,
488-
loc: { line: lineNumber, column: 0 },
491+
loc: {
492+
start: { line: lineNumber, column: maxLength },
493+
end: { line: lineNumber, column: lineLength }
494+
},
489495
messageId: 'max',
490496
data: {
491497
lineLength,

0 commit comments

Comments
 (0)