[英]How to disable eslint's rule for logging using 'node-file-logger' package in node.js?
In my code I am using ' node-file-logger ' for logging purposes and also using 'eslint'.在我的代码中,我使用“ node-file-logger ”进行日志记录并使用“ eslint”。 Eslint is showing warning for using log.Debug with fewer arguments than expected.
Eslint显示警告使用 log.Debug 的参数少于预期。
I want to know that how can I disable this Eslint rule without modifying my existing log.Debug statements?我想知道如何在不修改现有log.Debug语句的情况下禁用此 Eslint 规则?
node-file-logger logging interface for debug:用于调试的节点文件记录器日志记录接口:
Debug: function(errorMessage, serviceName, methodName, errorObj, cb) {
logger(options, 'Debug', errorMessage, serviceName, methodName, errorObj, cb);
},
My Code:我的代码:
log.Debug("Some debug log message")
Eslint:埃斯林特:
Expected 5 arguments, but got 2.ts(2554)
You can disable the eslint rule for any line using this您可以使用此禁用任何行的 eslint 规则
// eslint-disable-next-line name-of-your-rule
log.Debug("Some debug log message")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.