a9ce4e8417
This moves/exposes the `URL` polyfill similarily to the existing `ReadableStream` polyfill, rather than exposing it globally, to avoid interfering with any "outside" code. Both the `URL` and `ReadableStream` polyfills are now exposed on the `pdfjsLib` object, such that they are accessible to the viewer components. Furthermore, the `no-restricted-globals` ESLint rule is also enabled to prevent accidental usage of the native `URL`/`ReadableStream` implementations directly in the `src/` and `web/` folders; see also https://eslint.org/docs/rules/no-restricted-globals Addresses the remaining TODO in https://github.com/mozilla/pdf.js/projects/6
18 lines
228 B
Plaintext
18 lines
228 B
Plaintext
{
|
|
"extends": [
|
|
../.eslintrc
|
|
],
|
|
|
|
"rules": {
|
|
// Variables
|
|
"no-restricted-globals": ["error",
|
|
"ReadableStream",
|
|
"URL",
|
|
"WritableStream",
|
|
],
|
|
|
|
// ECMAScript 6
|
|
"no-var": "error",
|
|
},
|
|
}
|