Skip to content

Commit 021cf14

Browse files
committed
[eslint-patch] Optimize file read
1 parent a7a3243 commit 021cf14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eslint/eslint-patch/src/eslint-bulk-suppressions/bulk-suppressions-file.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ export function getSuppressionsConfigForEslintrcFolderPath(
5555
const suppressionsPath: string = `${eslintrcFolderPath}/${SUPPRESSIONS_JSON_FILENAME}`;
5656
let rawJsonFile: string | undefined;
5757
try {
58-
rawJsonFile = fs.readFileSync(suppressionsPath).toString();
58+
// Decoding during read hits an optimized fast path in NodeJS.
59+
rawJsonFile = fs.readFileSync(suppressionsPath, 'utf8');
5960
} catch (e) {
6061
throwIfAnythingOtherThanNotExistError(e);
6162
}

0 commit comments

Comments
 (0)