-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
@@ -58,6 +59,7 @@ export default { | |||
|
|||
const messages = []; | |||
let match = parseRegex.exec(result); | |||
let globalsOmitted = atom.config.get('linter-moonscript.omitGlobalCheck'); |
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.
Please observe this setting like this, there's no need to go through the complexity of determining what it is and what the current value is on every call 😉.
text: match[2], | ||
range: helpers.rangeFromLineNumber(textEditor, line), | ||
}); | ||
if (!globalRegex.test(match[2]) && !globalsOmitted) { |
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.
This should be ||
.
As it currently stands, if match[2]
contains accessing global
it will always be ignored. If it doesn't contain accessing global
then the globalsOmitted
option being false lets it show up, but if somebody enabled it then all messages will be hidden.
"omitGlobalCheck": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "Omit \"accessing global\" warning." |
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.
"warnings"
Sorry it took so long to get this reviewed! |
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.
LGTM, thanks!
Published in v1.1.0 🎉 |
This is a simple config variable that makes linter ignore "accessing global" warnings. It would be very useful since
moonc -l
has no support for this.