-
Notifications
You must be signed in to change notification settings - Fork 15
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
add no-print rule to enforce use of logger #19
Conversation
src/plugins/codeStyle/index.ts
Outdated
@@ -56,6 +56,11 @@ export default class CodeStyle { | |||
); | |||
} | |||
} | |||
}, | |||
PrintStatement: s => { | |||
if (noPrint) { |
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.
If not off
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.
So I made no-print rules a RulesSeverity
and I actually meant to remove this if.
'no-print'?: RuleSeverity;
If you'd rather it be a different type lmk
noPrint: (range: Range, severity: DiagnosticSeverity) => ({ | ||
severity: severity, | ||
code: CodeStyleError.NoPrint, | ||
message: `${CS} don't use direct Print statements`, |
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.
While we're doing another round of review, maybe:
"Avoid using direct Print statements"?
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.
sounds proper
@slheavner I think you should remove the |
f24e1ca
to
abcc84f
Compare
abcc84f
to
6a4d6d7
Compare
was wondering why that updated, reverted. |
Thanks! |
Similar to the
no-console
rules for eslint/tslint. Enforces the use of a logging framework rather than raw print statements.