Warn about console usage
This commit is contained in:
parent
4afaae13ca
commit
b5c6e655de
|
@ -330,11 +330,11 @@ module.exports = {
|
||||||
"no-constant-condition": [ 2, { "checkLoops": false } ],
|
"no-constant-condition": [ 2, { "checkLoops": false } ],
|
||||||
|
|
||||||
// Custom warnings:
|
// Custom warnings:
|
||||||
"no-console": 0,
|
"no-console": 1,
|
||||||
"no-unused-vars": 1,
|
"no-unused-vars": 1,
|
||||||
"indent": [ 0, 2, { "SwitchCase": 1 } ],
|
|
||||||
|
|
||||||
// TODO Consider fixing these:
|
// TODO Consider fixing these:
|
||||||
|
"indent": [ 0, 2, { "SwitchCase": 1 } ],
|
||||||
"valid-jsdoc": 0,
|
"valid-jsdoc": 0,
|
||||||
"new-cap": [ 0, { "properties": false, "capIsNewExceptionPattern": "^type_.*" }],
|
"new-cap": [ 0, { "properties": false, "capIsNewExceptionPattern": "^type_.*" }],
|
||||||
"no-lonely-if": 0,
|
"no-lonely-if": 0,
|
||||||
|
|
|
@ -19,12 +19,14 @@
|
||||||
* @requires encoding/base64
|
* @requires encoding/base64
|
||||||
* @requires enums
|
* @requires enums
|
||||||
* @requires config
|
* @requires config
|
||||||
|
* @requires util
|
||||||
* @module encoding/armor
|
* @module encoding/armor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import base64 from './base64.js';
|
import base64 from './base64.js';
|
||||||
import enums from '../enums.js';
|
import enums from '../enums.js';
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
|
import util from '../util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds out which Ascii Armoring type is used. Throws error if unknown type.
|
* Finds out which Ascii Armoring type is used. Throws error if unknown type.
|
||||||
|
@ -219,8 +221,8 @@ function verifyHeaders(headers) {
|
||||||
if (!/^([^\s:]|[^\s:][^:]*[^\s:]): .+$/.test(headers[i])) {
|
if (!/^([^\s:]|[^\s:][^:]*[^\s:]): .+$/.test(headers[i])) {
|
||||||
throw new Error('Improperly formatted armor header: ' + headers[i]);
|
throw new Error('Improperly formatted armor header: ' + headers[i]);
|
||||||
}
|
}
|
||||||
if (config.debug && !/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(headers[i])) {
|
if (!/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(headers[i])) {
|
||||||
console.log('Unknown header: ' + headers[i]);
|
util.print_debug_error(new Error('Unknown header: ' + headers[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
// License along with this library; if not, write to the Free Software
|
// License along with this library; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This object contains utility functions
|
* This object contains utility functions
|
||||||
* @requires config
|
* @requires config
|
||||||
|
|
Loading…
Reference in New Issue
Block a user