8000 Disable no-control-regex rule for the line containing \x1b in regex · xaviernoder/log4js-node@9a29125 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 9a29125

Browse files
committed
Disable no-control-regex rule for the line containing \x1b in regex
Signed-off-by: Cocoa <0xbbc@0xbbc.com>
1 parent b18846c commit 9a29125

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/appenders/file.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ function fileAppender(file, layout, logSize, numBackups, options, timezoneOffset
5454

5555
const app = function (loggingEvent) {
5656
if (options.removeColor === true) {
57+
/* eslint-disable no-control-regex */
5758
const regex = new RegExp("\x1b[[0-9;]*m", "g");
59+
/* eslint-enable no-control-regex */
5860
for (let i = 0; i < loggingEvent.data.length; i += 1) {
5961
let d = loggingEvent.data[i];
6062
d = d.replace(regex, '');

0 commit comments

Comments
 (0)
0