Skip to content
Permalink
Browse files

Fix: Report correct line in hint-amp-validator (was off-by-one)

  • Loading branch information...
antross committed Mar 15, 2019
1 parent ae51244 commit 462f8f72abff162053a4d47cca4a887ccf4ef4d4
Showing with 2 additions and 6 deletions.
  1. +1 −1 packages/hint-amp-validator/src/hint.ts
  2. +1 −5 packages/hint-amp-validator/tests/tests.ts
@@ -73,7 +73,7 @@ export default class AmpValidatorHint implements IHint {
} else {
const location = {
column: error.col,
line: error.line
line: error.line - 1 // The validator uses 1-based lines (but 0-based columns)
};

context.report(resource, message, { location });
@@ -25,11 +25,7 @@ const defaultTests: HintTest[] = [
reports: [
{
message: `The mandatory attribute '⚡' is missing in tag 'html'. (https://www.ampproject.org/docs/reference/spec#required-markup)`,
// TODO: position: { match: '<html lang="en">' } // { column: 0, line: 1 }
position: {
column: 0,
line: 2
}
position: { match: '<html lang="en">' }
}
]
},

0 comments on commit 462f8f7

Please sign in to comment.
You can’t perform that action at this time.