-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change lines to 1based. #3
base: master
Are you sure you want to change the base?
Conversation
* @param {number} [line=0] - errored line | ||
* @param {number} [column=0] - errored column | ||
* @param {number} [line=1] - errored line | ||
* @param {number} [column=1] - errored column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? It can be 0:0 by default (as undefined)
@@ -7,16 +7,16 @@ module.exports = Warnie; | |||
* @name Warnie | |||
* @param {string} message - text message of error | |||
* @param {string} filename - name of file the error belongs | |||
* @param {number} [line=0] - errored line | |||
* @param {number} [column=0] - errored column | |||
* @param {number} [severity=0] - severity of the error, one of [-1, 0, 1, 2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let it be another issue, please?
this.line = line|0; | ||
this.column = column|0; | ||
this.line = line||1; | ||
this.column = column||1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|0
here used to convert to number, not for default value.
var pointer = Warnie.renderPointer(Warnie.renderLineNumber(0).length + this.column); | ||
var result = [ | ||
renderLine(this.line, lines[this.line]), | ||
renderLine(humanLine, lines[humanLine]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
humanLine is one-based now. Here you need zero-based-line.
fix #1