Add no console.log lint rule

This commit is contained in:
Niklas von Hertzen 2017-09-25 23:01:59 +08:00
parent 929b9de6e0
commit ae47d901a1
2 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@
"prettier" "prettier"
], ],
"rules": { "rules": {
"no-console": ["error", { "allow": ["warn", "error"] }],
"flowtype/boolean-style": [ "flowtype/boolean-style": [
2, 2,
"boolean" "boolean"

View File

@ -25,7 +25,9 @@ export type Options = {
}; };
const html2canvas = (element: HTMLElement, conf: ?Options): Promise<*> => { const html2canvas = (element: HTMLElement, conf: ?Options): Promise<*> => {
// eslint-disable-next-line no-console
if (typeof console === 'object' && typeof console.log === 'function') { if (typeof console === 'object' && typeof console.log === 'function') {
// eslint-disable-next-line no-console
console.log(`html2canvas ${__VERSION__}`); console.log(`html2canvas ${__VERSION__}`);
} }