diff --git a/.eslintrc.js b/.eslintrc.js index 37ab59c2..ba34bc3c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -331,7 +331,7 @@ module.exports = { // Custom warnings: "no-console": 0, - "no-unused-vars": 0, + "no-unused-vars": 1, "indent": [ 0, 2, { "SwitchCase": 1 } ], // TODO Consider fixing these: diff --git a/src/cleartext.js b/src/cleartext.js index 8c423b96..9503364f 100644 --- a/src/cleartext.js +++ b/src/cleartext.js @@ -16,7 +16,6 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /** - * @requires config * @requires encoding/armor * @requires enums * @requires util @@ -25,7 +24,6 @@ * @module cleartext */ -import config from './config'; import armor from './encoding/armor'; import enums from './enums'; import util from './util'; diff --git a/src/crypto/cipher/twofish.js b/src/crypto/cipher/twofish.js index bed3fdb4..bf1dee55 100644 --- a/src/crypto/cipher/twofish.js +++ b/src/crypto/cipher/twofish.js @@ -53,12 +53,9 @@ function createTwofish() { let dataBytes = null; let dataOffset = -1; // var dataLength = -1; - let algorithmName = null; // var idx2 = -1; // - algorithmName = "twofish"; - let tfsKey = []; let tfsM = [ [], diff --git a/src/crypto/crypto.js b/src/crypto/crypto.js index 9bc5f52e..c3692837 100644 --- a/src/crypto/crypto.js +++ b/src/crypto/crypto.js @@ -28,7 +28,6 @@ * @requires type/mpi * @requires type/oid * @requires enums - * @requires util * @module crypto/crypto */ @@ -40,7 +39,6 @@ import type_kdf_params from '../type/kdf_params'; import type_mpi from '../type/mpi'; import type_oid from '../type/oid'; import enums from '../enums'; -import util from '../util'; function constructParams(types, data) { return types.map(function(type, i) { diff --git a/src/crypto/gcm.js b/src/crypto/gcm.js index 97b7aed3..888decd8 100644 --- a/src/crypto/gcm.js +++ b/src/crypto/gcm.js @@ -19,13 +19,11 @@ * @fileoverview This module wraps native AES-GCM en/decryption for both * the WebCrypto api as well as node.js' crypto api. * @requires asmcrypto.js - * @requires config * @requires util * @module crypto/gcm */ import { AES_GCM } from 'asmcrypto.js/src/aes/gcm/exports'; -import config from '../config'; import util from '../util'; const webCrypto = util.getWebCrypto(); // no GCM support in IE11, Safari 9 diff --git a/src/crypto/public_key/dsa.js b/src/crypto/public_key/dsa.js index ef3be1e5..3d43e09b 100644 --- a/src/crypto/public_key/dsa.js +++ b/src/crypto/public_key/dsa.js @@ -20,7 +20,6 @@ * @requires bn.js * @requires crypto/hash * @requires crypto/random - * @requires config * @requires util * @module crypto/public_key/dsa */ @@ -28,7 +27,6 @@ import BN from 'bn.js'; import hash from '../hash'; import random from '../random'; -import config from '../../config'; import util from '../../util'; const one = new BN(1); diff --git a/src/crypto/public_key/elliptic/ecdh.js b/src/crypto/public_key/elliptic/ecdh.js index ef256b36..ccbfa30a 100644 --- a/src/crypto/public_key/elliptic/ecdh.js +++ b/src/crypto/public_key/elliptic/ecdh.js @@ -21,7 +21,6 @@ * @requires crypto/aes_kw * @requires crypto/cipher * @requires crypto/hash - * @requires type/oid * @requires type/kdf_params * @requires enums * @requires util @@ -34,7 +33,6 @@ import aes_kw from '../../aes_kw'; import cipher from '../../cipher'; import hash from '../../hash'; import type_kdf_params from '../../../type/kdf_params'; -import type_oid from '../../../type/oid'; import enums from '../../../enums'; import util from '../../../util'; diff --git a/src/crypto/public_key/elliptic/ecdsa.js b/src/crypto/public_key/elliptic/ecdsa.js index a9c8ac89..9bcae5ef 100644 --- a/src/crypto/public_key/elliptic/ecdsa.js +++ b/src/crypto/public_key/elliptic/ecdsa.js @@ -17,12 +17,10 @@ /** * @fileoverview Implementation of ECDSA following RFC6637 for Openpgpjs - * @requires crypto/hash * @requires crypto/public_key/elliptic/curve * @module crypto/public_key/elliptic/ecdsa */ -import hash from '../../hash'; import Curve from './curves'; /** diff --git a/src/crypto/public_key/elliptic/eddsa.js b/src/crypto/public_key/elliptic/eddsa.js index 97fe7de9..a3c59b16 100644 --- a/src/crypto/public_key/elliptic/eddsa.js +++ b/src/crypto/public_key/elliptic/eddsa.js @@ -17,14 +17,10 @@ /** * @fileoverview Implementation of EdDSA following RFC4880bis-03 for OpenPGP - * @requires bn.js - * @requires crypto/hash * @requires crypto/public_key/elliptic/curve * @module crypto/public_key/elliptic/eddsa */ -import BN from 'bn.js'; -import hash from '../../hash'; import Curve from './curves'; /** diff --git a/src/crypto/public_key/elliptic/key.js b/src/crypto/public_key/elliptic/key.js index 6c591a30..3d0e0f78 100644 --- a/src/crypto/public_key/elliptic/key.js +++ b/src/crypto/public_key/elliptic/key.js @@ -18,7 +18,7 @@ /** * @fileoverview Wrapper for a KeyPair of an Elliptic Curve * @requires bn.js - * @requires crypto/public_key/elliptic/curve + * @requires crypto/public_key/elliptic/curves * @requires crypto/hash * @requires util * @requires enums @@ -27,7 +27,7 @@ */ import BN from 'bn.js'; -import { webCurves, nodeCurves } from './curves'; +import { webCurves } from './curves'; import hash from '../../hash'; import util from '../../../util'; import enums from '../../../enums'; diff --git a/src/crypto/random.js b/src/crypto/random.js index b4dc75ea..1a71c157 100644 --- a/src/crypto/random.js +++ b/src/crypto/random.js @@ -20,13 +20,11 @@ /** * @fileoverview Provides tools for retrieving secure randomness from browsers or Node.js * @requires bn.js - * @requires type/mpi * @requires util * @module crypto/random */ import BN from 'bn.js'; -import type_mpi from '../type/mpi'; import util from '../util'; // Do not use util.getNodeCrypto because we need this regardless of use_native setting diff --git a/src/packet/compressed.js b/src/packet/compressed.js index 6df60b31..b6b46190 100644 --- a/src/packet/compressed.js +++ b/src/packet/compressed.js @@ -126,7 +126,6 @@ export default Compressed; const nodeZlib = util.getNodeZlib(); -const Buffer = util.getNodeBuffer(); function node_zlib(func, options = {}) { return function (data) { diff --git a/src/packet/public_key_encrypted_session_key.js b/src/packet/public_key_encrypted_session_key.js index f70c166c..895586da 100644 --- a/src/packet/public_key_encrypted_session_key.js +++ b/src/packet/public_key_encrypted_session_key.js @@ -16,7 +16,6 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /** - * @requires type/ecdh_symkey * @requires type/keyid * @requires type/mpi * @requires crypto @@ -24,7 +23,6 @@ * @requires util */ -import type_ecdh_symkey from '../type/ecdh_symkey'; import type_keyid from '../type/keyid'; import type_mpi from '../type/mpi'; import crypto from '../crypto'; diff --git a/src/worker/worker.js b/src/worker/worker.js index 99422df6..0dc704f9 100644 --- a/src/worker/worker.js +++ b/src/worker/worker.js @@ -46,7 +46,7 @@ function randomCallback() { self.postMessage({ event: 'request-seed', amount: MAX_SIZE_RANDOM_BUFFER }); } - return new Promise(function(resolve, reject) { + return new Promise(function(resolve) { randomQueue.push(resolve); }); }