Restricts loading of the N/log module in favor of global log
.
In most cases, global log
can be used instead of the N/log module.
By default, the N/log module is allowed in client scripts because there it is used to log to NetSuite where it would otherwise be impossible. See the rule options below to modify this.
✅ The following pattern is correct:
/* eslint suitescript/no-log-module: "error" */
define([], function() {
log.debug('Title', 'Details');
});
❌ The following pattern is incorrect:
/* eslint suitescript/no-log-module: "error" */
define(['N/log'], function(log) {
log.debug('Title', 'Details');
});
'suitescript/no-log-module': [<enabled>, {
allowInClientScripts: <boolean>
}]
default: true
Allows the N/log module to be loaded in client scripts.
/* eslint suitescript/no-log-module: ["error", { allowInClientScripts: false }] */
/**
* @NScriptType ClientScript',
*/
define([], function() {
console.log("can't use N\log");
});
This rule was introduced in version 1.0.0.