Merge pull request #11603 from Snuffleupagus/eslint-no-buffer-constructor

Enable the `no-buffer-constructor` ESLint rule
This commit is contained in:
Tim van der Meij 2020-02-16 13:13:54 +01:00 committed by GitHub
commit f6c813710a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -127,6 +127,9 @@
"args": "none",
}],
// Node.js and CommonJS
"no-buffer-constructor": "error",
// Stylistic Issues
"lines-between-class-members": ["error", "always"],
"max-len": ["error", {

View File

@ -145,7 +145,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
input = literals;
} else {
// eslint-disable-next-line no-undef
input = new Buffer(literals);
input = Buffer.from(literals);
}
const output = __non_webpack_require__("zlib").deflateSync(input, {
level: 9,