mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Enable the no-buffer-constructor
ESLint rule
According to https://nodejs.org/api/buffer.html#buffer_class_buffer: `new Buffer(...)` is deprecated in up-to-date versions of Node.js, hence you want to prevent it from being accidentally used. Please see https://eslint.org/docs/rules/no-buffer-constructor for additional information.
This commit is contained in:
parent
f6ffc2bf37
commit
6ebd851d27
2 changed files with 4 additions and 1 deletions
|
@ -127,6 +127,9 @@
|
||||||
"args": "none",
|
"args": "none",
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
// Node.js and CommonJS
|
||||||
|
"no-buffer-constructor": "error",
|
||||||
|
|
||||||
// Stylistic Issues
|
// Stylistic Issues
|
||||||
"lines-between-class-members": ["error", "always"],
|
"lines-between-class-members": ["error", "always"],
|
||||||
"max-len": ["error", {
|
"max-len": ["error", {
|
||||||
|
|
|
@ -145,7 +145,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||||
input = literals;
|
input = literals;
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
input = new Buffer(literals);
|
input = Buffer.from(literals);
|
||||||
}
|
}
|
||||||
const output = __non_webpack_require__("zlib").deflateSync(input, {
|
const output = __non_webpack_require__("zlib").deflateSync(input, {
|
||||||
level: 9,
|
level: 9,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue