diff --git a/.eslintignore b/.eslintignore index f18c60d5..911c8af1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ dist test/lib/ test/typescript/definitions.js +docs diff --git a/.eslintrc.js b/.eslintrc.js index a0b5d7bf..ce6cad06 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -328,6 +328,7 @@ module.exports = { // eslint-plugin-import rules: "import/extensions": "never", "import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}], + "import/no-unassigned-import": "error", // Custom silencers: "camelcase": 0, diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 40f4f7c9..b099dbcc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x, 15.x] + node-version: [12.x, 14.x, 15.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/package-lock.json b/package-lock.json index fcf09406..ca41012b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4897,12 +4897,6 @@ } } }, - "text-encoding-utf-8": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", - "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==", - "dev": true - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/package.json b/package.json index cf2bf47b..b33b0aec 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,6 @@ "rollup-plugin-terser": "^5.3.0", "seek-bzip": "github:openpgpjs/seek-bzip#4b89457f20c0e1921b4689106a31c99782c29829", "sinon": "^4.3.0", - "text-encoding-utf-8": "^1.0.2", "tweetnacl": "github:openpgpjs/tweetnacl-js#3dae25bd3eaa77173f3405676b595721dde92eec", "typescript": "^4.1.2", "web-stream-tools": "github:openpgpjs/web-stream-tools#5e6cb1a976d50c421091907615cf7cce77ac4f2a", diff --git a/src/openpgp.js b/src/openpgp.js index 8fb44e76..46bcc326 100644 --- a/src/openpgp.js +++ b/src/openpgp.js @@ -21,7 +21,6 @@ import { Message } from './message'; import { CleartextMessage } from './cleartext'; import { generate, reformat } from './key'; import defaultConfig from './config'; -import './polyfills'; import util from './util'; let toNativeReadable; diff --git a/src/polyfills.js b/src/polyfills.js deleted file mode 100644 index 7183e0f5..00000000 --- a/src/polyfills.js +++ /dev/null @@ -1,10 +0,0 @@ -if (typeof TextEncoder === 'undefined') { - const nodeUtil = require('util') || {}; - globalThis.TextEncoder = nodeUtil.TextEncoder; - globalThis.TextDecoder = nodeUtil.TextDecoder; -} -if (typeof TextEncoder === 'undefined') { - const textEncoding = require('text-encoding-utf-8'); - globalThis.TextEncoder = textEncoding.TextEncoder; - globalThis.TextDecoder = textEncoding.TextDecoder; -}