diff --git a/.eslintrc.js b/.eslintrc.js
index e5f4eefd..f9bfaa96 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -295,7 +295,7 @@ module.exports = {
       "error",
       "never"
     ],
-    "space-infix-ops": "off",
+    "space-infix-ops": "error",
     "space-unary-ops": "error",
     "spaced-comment": "off",
     "strict": "off",
@@ -315,6 +315,13 @@ module.exports = {
       "never"
     ],
     "indent": [ "error", 2, { "SwitchCase": 1 } ],
+    "no-buffer-constructor": "error",
+    "no-lonely-if": "error",
+    "no-unused-vars": "error",
+
+    // eslint-plugin-import rules:
+    "import/extensions": "never",
+    "import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}],
 
     // Custom silencers:
     "camelcase": 0,
@@ -330,17 +337,9 @@ module.exports = {
     "no-use-before-define": [ 2, { "functions": false, "classes": true, "variables": false }],
     "no-unused-expressions": [ 2, { "allowShortCircuit": true } ],
     "no-constant-condition": [ 2, { "checkLoops": false } ],
+    "new-cap": [ 2, { "properties": false, "capIsNewExceptionPattern": "CMAC|CBC|OMAC|CTR", "newIsCapExceptionPattern": "type|hash*"}],
 
     // Custom warnings:
     "no-console": 1,
-    "no-unused-vars": 1,
-
-    // TODO Consider fixing these:
-    "valid-jsdoc": 0,
-    "new-cap": [ 0, { "properties": false, "capIsNewExceptionPattern": "^type_.*" }],
-    "no-lonely-if": 0,
-    "import/extensions": 0,
-    "import/no-extraneous-dependencies": 0,
-    "no-buffer-constructor": 0, // deprecated
   }
 };
diff --git a/src/cleartext.js b/src/cleartext.js
index 4f7c73c9..45100f35 100644
--- a/src/cleartext.js
+++ b/src/cleartext.js
@@ -72,7 +72,7 @@ CleartextMessage.prototype.getSigningKeyIds = function() {
  * @returns {Promise<module:cleartext.CleartextMessage>} new cleartext message with signed content
  * @async
  */
-CleartextMessage.prototype.sign = async function(privateKeys, signature=null, date=new Date(), userIds=[]) {
+CleartextMessage.prototype.sign = async function(privateKeys, signature = null, date = new Date(), userIds = []) {
   return new CleartextMessage(this.text, await this.signDetached(privateKeys, signature, date, userIds));
 };
 
@@ -85,7 +85,7 @@ CleartextMessage.prototype.sign = async function(privateKeys, signature=null, da
  * @returns {Promise<module:signature.Signature>}      new detached signature of message content
  * @async
  */
-CleartextMessage.prototype.signDetached = async function(privateKeys, signature=null, date=new Date(), userIds=[]) {
+CleartextMessage.prototype.signDetached = async function(privateKeys, signature = null, date = new Date(), userIds = []) {
   const literalDataPacket = new packet.Literal();
   literalDataPacket.setText(this.text);
 
@@ -99,7 +99,7 @@ CleartextMessage.prototype.signDetached = async function(privateKeys, signature=
  * @returns {Promise<Array<{keyid: module:type/keyid, valid: Boolean}>>} list of signer's keyid and validity of signature
  * @async
  */
-CleartextMessage.prototype.verify = function(keys, date=new Date()) {
+CleartextMessage.prototype.verify = function(keys, date = new Date()) {
   return this.verifyDetached(this.signature, keys, date);
 };
 
@@ -110,7 +110,7 @@ CleartextMessage.prototype.verify = function(keys, date=new Date()) {
  * @returns {Promise<Array<{keyid: module:type/keyid, valid: Boolean}>>} list of signer's keyid and validity of signature
  * @async
  */
-CleartextMessage.prototype.verifyDetached = function(signature, keys, date=new Date()) {
+CleartextMessage.prototype.verifyDetached = function(signature, keys, date = new Date()) {
   const signatureList = signature.packets;
   const literalDataPacket = new packet.Literal();
   // we assume that cleartext signature is generated based on UTF8 cleartext
diff --git a/src/crypto/aes_kw.js b/src/crypto/aes_kw.js
index d82c5745..8588a0a1 100644
--- a/src/crypto/aes_kw.js
+++ b/src/crypto/aes_kw.js
@@ -27,12 +27,12 @@ import cipher from './cipher';
 import util from '../util';
 
 function wrap(key, data) {
-  const aes = new cipher["aes" + (key.length*8)](key);
+  const aes = new cipher["aes" + (key.length * 8)](key);
   const IV = new Uint32Array([0xA6A6A6A6, 0xA6A6A6A6]);
   const P = unpack(data);
   let A = IV;
   const R = P;
-  const n = P.length/2;
+  const n = P.length / 2;
   const t = new Uint32Array([0, 0]);
   let B = new Uint32Array(4);
   for (let j = 0; j <= 5; ++j) {
@@ -42,8 +42,8 @@ function wrap(key, data) {
       B[0] = A[0];
       B[1] = A[1];
       // B = A || R[i]
-      B[2] = R[2*i];
-      B[3] = R[2*i+1];
+      B[2] = R[2 * i];
+      B[3] = R[2 * i + 1];
       // B = AES(K, B)
       B = unpack(aes.encrypt(pack(B)));
       // A = MSB(64, B) ^ t
@@ -51,20 +51,20 @@ function wrap(key, data) {
       A[0] ^= t[0];
       A[1] ^= t[1];
       // R[i] = LSB(64, B)
-      R[2*i] = B[2];
-      R[2*i+1] = B[3];
+      R[2 * i] = B[2];
+      R[2 * i + 1] = B[3];
     }
   }
   return pack(A, R);
 }
 
 function unwrap(key, data) {
-  const aes = new cipher["aes" + (key.length*8)](key);
+  const aes = new cipher["aes" + (key.length * 8)](key);
   const IV = new Uint32Array([0xA6A6A6A6, 0xA6A6A6A6]);
   const C = unpack(data);
   let A = C.subarray(0, 2);
   const R = C.subarray(2);
-  const n = C.length/2-1;
+  const n = C.length / 2 - 1;
   const t = new Uint32Array([0, 0]);
   let B = new Uint32Array(4);
   for (let j = 5; j >= 0; --j) {
@@ -74,15 +74,15 @@ function unwrap(key, data) {
       B[0] = A[0] ^ t[0];
       B[1] = A[1] ^ t[1];
       // B = (A ^ t) || R[i]
-      B[2] = R[2*i];
-      B[3] = R[2*i+1];
+      B[2] = R[2 * i];
+      B[3] = R[2 * i + 1];
       // B = AES-1(B)
       B = unpack(aes.decrypt(pack(B)));
       // A = MSB(64, B)
       A = B.subarray(0, 2);
       // R[i] = LSB(64, B)
-      R[2*i] = B[2];
-      R[2*i+1] = B[3];
+      R[2 * i] = B[2];
+      R[2 * i + 1] = B[3];
     }
   }
   if (A[0] === IV[0] && A[1] === IV[1]) {
@@ -108,9 +108,9 @@ function unpack(data) {
   const { length } = data;
   const buffer = createArrayBuffer(data);
   const view = new DataView(buffer);
-  const arr = new Uint32Array(length/4);
-  for (let i=0; i<length/4; ++i) {
-    arr[i] = view.getUint32(4*i);
+  const arr = new Uint32Array(length / 4);
+  for (let i = 0; i < length / 4; ++i) {
+    arr[i] = view.getUint32(4 * i);
   }
   return arr;
 }
diff --git a/src/crypto/cfb.js b/src/crypto/cfb.js
index 1a83972e..9686c5e8 100644
--- a/src/crypto/cfb.js
+++ b/src/crypto/cfb.js
@@ -137,15 +137,15 @@ async function webEncrypt(algo, key, pt, iv) {
 }
 
 function nodeEncrypt(algo, key, pt, iv) {
-  key = new Buffer(key);
-  iv = new Buffer(iv);
+  key = Buffer.from(key);
+  iv = Buffer.from(iv);
   const cipherObj = new nodeCrypto.createCipheriv('aes-' + algo.substr(3, 3) + '-cfb', key, iv);
-  return stream.transform(pt, value => new Uint8Array(cipherObj.update(new Buffer(value))));
+  return stream.transform(pt, value => new Uint8Array(cipherObj.update(Buffer.from(value))));
 }
 
 function nodeDecrypt(algo, key, ct, iv) {
-  key = new Buffer(key);
-  iv = new Buffer(iv);
+  key = Buffer.from(key);
+  iv = Buffer.from(iv);
   const decipherObj = new nodeCrypto.createDecipheriv('aes-' + algo.substr(3, 3) + '-cfb', key, iv);
-  return stream.transform(ct, value => new Uint8Array(decipherObj.update(new Buffer(value))));
+  return stream.transform(ct, value => new Uint8Array(decipherObj.update(Buffer.from(value))));
 }
diff --git a/src/crypto/cmac.js b/src/crypto/cmac.js
index d3675fbd..e6ce66c1 100644
--- a/src/crypto/cmac.js
+++ b/src/crypto/cmac.js
@@ -83,9 +83,9 @@ async function CBC(key) {
     };
   }
   if (util.getNodeCrypto()) { // Node crypto library
-    key = new Buffer(key);
+    key = Buffer.from(key);
     return async function(pt) {
-      pt = new Buffer(pt);
+      pt = Buffer.from(pt);
       const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-cbc', key, zeroBlock);
       const ct = en.update(pt);
       return new Uint8Array(ct);
diff --git a/src/crypto/eax.js b/src/crypto/eax.js
index 6eed009b..0844b8af 100644
--- a/src/crypto/eax.js
+++ b/src/crypto/eax.js
@@ -61,10 +61,10 @@ async function CTR(key) {
     };
   }
   if (util.getNodeCrypto()) { // Node crypto library
-    key = new Buffer(key);
+    key = Buffer.from(key);
     return async function(pt, iv) {
-      pt = new Buffer(pt);
-      iv = new Buffer(iv);
+      pt = Buffer.from(pt);
+      iv = Buffer.from(iv);
       const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-ctr', key, iv);
       const ct = Buffer.concat([en.update(pt), en.final()]);
       return new Uint8Array(ct);
diff --git a/src/crypto/gcm.js b/src/crypto/gcm.js
index fa57f905..f028c3b0 100644
--- a/src/crypto/gcm.js
+++ b/src/crypto/gcm.js
@@ -49,7 +49,7 @@ async function GCM(cipher, key) {
     const _key = await webCrypto.importKey('raw', key, { name: ALGO }, false, ['encrypt', 'decrypt']);
 
     return {
-      encrypt: async function(pt, iv, adata=new Uint8Array()) {
+      encrypt: async function(pt, iv, adata = new Uint8Array()) {
         if (
           !pt.length ||
           // iOS does not support GCM-en/decrypting empty messages
@@ -63,7 +63,7 @@ async function GCM(cipher, key) {
         return new Uint8Array(ct);
       },
 
-      decrypt: async function(ct, iv, adata=new Uint8Array()) {
+      decrypt: async function(ct, iv, adata = new Uint8Array()) {
         if (
           ct.length === tagLength ||
           // iOS does not support GCM-en/decrypting empty messages
@@ -80,23 +80,23 @@ async function GCM(cipher, key) {
   }
 
   if (util.getNodeCrypto()) { // Node crypto library
-    key = new Buffer(key);
+    key = Buffer.from(key);
 
     return {
-      encrypt: async function(pt, iv, adata=new Uint8Array()) {
-        pt = new Buffer(pt);
-        iv = new Buffer(iv);
-        adata = new Buffer(adata);
+      encrypt: async function(pt, iv, adata = new Uint8Array()) {
+        pt = Buffer.from(pt);
+        iv = Buffer.from(iv);
+        adata = Buffer.from(adata);
         const en = new nodeCrypto.createCipheriv('aes-' + (key.length * 8) + '-gcm', key, iv);
         en.setAAD(adata);
         const ct = Buffer.concat([en.update(pt), en.final(), en.getAuthTag()]); // append auth tag to ciphertext
         return new Uint8Array(ct);
       },
 
-      decrypt: async function(ct, iv, adata=new Uint8Array()) {
-        ct = new Buffer(ct);
-        iv = new Buffer(iv);
-        adata = new Buffer(adata);
+      decrypt: async function(ct, iv, adata = new Uint8Array()) {
+        ct = Buffer.from(ct);
+        iv = Buffer.from(iv);
+        adata = Buffer.from(adata);
         const de = new nodeCrypto.createDecipheriv('aes-' + (key.length * 8) + '-gcm', key, iv);
         de.setAAD(adata);
         de.setAuthTag(ct.slice(ct.length - tagLength, ct.length)); // read auth tag at end of ciphertext
diff --git a/src/crypto/hash/index.js b/src/crypto/hash/index.js
index 97f9eb28..a8aecd69 100644
--- a/src/crypto/hash/index.js
+++ b/src/crypto/hash/index.js
@@ -30,7 +30,7 @@ function node_hash(type) {
   return async function (data) {
     const shasum = nodeCrypto.createHash(type);
     return stream.transform(data, value => {
-      shasum.update(new Buffer(value));
+      shasum.update(Buffer.from(value));
     }, () => new Uint8Array(shasum.digest()));
   };
 }
diff --git a/src/crypto/public_key/elliptic/ecdh.js b/src/crypto/public_key/elliptic/ecdh.js
index e129b5b8..9cc223cb 100644
--- a/src/crypto/public_key/elliptic/ecdh.js
+++ b/src/crypto/public_key/elliptic/ecdh.js
@@ -55,7 +55,7 @@ function buildEcdhParam(public_algo, oid, cipher_algo, hash_algo, fingerprint) {
 }
 
 // Key Derivation Function (RFC 6637)
-async function kdf(hash_algo, X, length, param, stripLeading=false, stripTrailing=false) {
+async function kdf(hash_algo, X, length, param, stripLeading = false, stripTrailing = false) {
   // Note: X is little endian for Curve25519, big-endian for all others.
   // This is not ideal, but the RFC's are unclear
   // https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-02#appendix-B
@@ -386,8 +386,8 @@ async function nodePublicEphemeralKey(curve, Q) {
  */
 function rawPublicToJwk(payloadSize, name, publicKey) {
   const len = payloadSize;
-  const bufX = publicKey.slice(1, len+1);
-  const bufY = publicKey.slice(len+1, len*2+1);
+  const bufX = publicKey.slice(1, len + 1);
+  const bufY = publicKey.slice(len + 1, len * 2 + 1);
   // https://www.rfc-editor.org/rfc/rfc7518.txt
   const jwKey = {
     kty: "EC",
@@ -422,7 +422,7 @@ function jwkToRawPublic(jwk) {
   const publicKey = new Uint8Array(bufX.length + bufY.length + 1);
   publicKey[0] = 0x04;
   publicKey.set(bufX, 1);
-  publicKey.set(bufY, bufX.length+1);
+  publicKey.set(bufY, bufX.length + 1);
   return publicKey;
 }
 
diff --git a/src/encoding/base64.js b/src/encoding/base64.js
index 0a91d820..9b086746 100644
--- a/src/encoding/base64.js
+++ b/src/encoding/base64.js
@@ -99,11 +99,10 @@ function s2r(t, u = false) {
 /**
  * Convert radix-64 to binary array
  * @param {String | ReadableStream<String>} t radix-64 string to convert
- * @param {bool} u if true, input is interpreted as URL-safe
  * @returns {Uint8Array | ReadableStream<Uint8Array>} binary array version of input string
  * @static
  */
-function r2s(t, u) {
+function r2s(t) {
   // TODO check atob alternative
   let c;
 
diff --git a/src/key.js b/src/key.js
index 0d441a91..ffa3e9ab 100644
--- a/src/key.js
+++ b/src/key.js
@@ -166,7 +166,7 @@ Key.prototype.toPacketlist = function() {
  * @param  {type/keyid} keyId
  * @returns {Array<module:key~SubKey>}
  */
-Key.prototype.getSubkeys = function(keyId=null) {
+Key.prototype.getSubkeys = function(keyId = null) {
   const subKeys = [];
   this.subKeys.forEach(subKey => {
     if (!keyId || subKey.getKeyId().equals(keyId, true)) {
@@ -182,7 +182,7 @@ Key.prototype.getSubkeys = function(keyId=null) {
  * @param  {type/keyid} keyId
  * @returns {Array<module:key.Key|module:key~SubKey>}
  */
-Key.prototype.getKeys = function(keyId=null) {
+Key.prototype.getKeys = function(keyId = null) {
   const keys = [];
   if (!keyId || this.getKeyId().equals(keyId, true)) {
     keys.push(this);
@@ -271,7 +271,7 @@ Key.prototype.armor = function() {
  * @returns {Promise<module:packet.Signature>} The latest valid signature
  * @async
  */
-async function getLatestValidSignature(signatures, primaryKey, signatureType, dataToVerify, date=new Date()) {
+async function getLatestValidSignature(signatures, primaryKey, signatureType, dataToVerify, date = new Date()) {
   let signature;
   for (let i = signatures.length - 1; i >= 0; i--) {
     if (
@@ -295,7 +295,7 @@ async function getLatestValidSignature(signatures, primaryKey, signatureType, da
  * @returns {Promise<module:key.Key|module:key~SubKey|null>} key or null if no signing key has been found
  * @async
  */
-Key.prototype.getSigningKey = async function (keyId=null, date=new Date(), userId={}) {
+Key.prototype.getSigningKey = async function (keyId = null, date = new Date(), userId = {}) {
   const primaryKey = this.keyPacket;
   if (await this.verifyPrimaryKey(date, userId) === enums.keyStatus.valid) {
     const subKeys = this.subKeys.slice().sort((a, b) => b.keyPacket.created - a.keyPacket.created);
@@ -343,7 +343,7 @@ Key.prototype.getSigningKey = async function (keyId=null, date=new Date(), userI
  * @returns {Promise<module:key.Key|module:key~SubKey|null>} key or null if no encryption key has been found
  * @async
  */
-Key.prototype.getEncryptionKey = async function(keyId, date=new Date(), userId={}) {
+Key.prototype.getEncryptionKey = async function(keyId, date = new Date(), userId = {}) {
   const primaryKey = this.keyPacket;
   if (await this.verifyPrimaryKey(date, userId) === enums.keyStatus.valid) {
     // V4: by convention subkeys are preferred for encryption service
@@ -389,7 +389,7 @@ Key.prototype.getEncryptionKey = async function(keyId, date=new Date(), userId={
  * @returns {Promise<Array<module:packet.SecretKey|module:packet.SecretSubkey>>}
  * @async
  */
-Key.prototype.encrypt = async function(passphrases, keyId=null) {
+Key.prototype.encrypt = async function(passphrases, keyId = null) {
   if (!this.isPrivate()) {
     throw new Error("Nothing to encrypt in a public key");
   }
@@ -415,7 +415,7 @@ Key.prototype.encrypt = async function(passphrases, keyId=null) {
  * @returns {Promise<Boolean>} true if all matching key and subkey packets decrypted successfully
  * @async
  */
-Key.prototype.decrypt = async function(passphrases, keyId=null) {
+Key.prototype.decrypt = async function(passphrases, keyId = null) {
   if (!this.isPrivate()) {
     throw new Error("Nothing to decrypt in a public key");
   }
@@ -452,7 +452,7 @@ Key.prototype.decrypt = async function(passphrases, keyId=null) {
  * @returns {Promise<Boolean>}                      True if the certificate is revoked
  * @async
  */
-Key.prototype.isRevoked = async function(signature, key, date=new Date()) {
+Key.prototype.isRevoked = async function(signature, key, date = new Date()) {
   return isDataRevoked(
     this.keyPacket, enums.signature.key_revocation, { key: this.keyPacket }, this.revocationSignatures, signature, key, date
   );
@@ -466,7 +466,7 @@ Key.prototype.isRevoked = async function(signature, key, date=new Date()) {
  * @returns {Promise<module:enums.keyStatus>} The status of the primary key
  * @async
  */
-Key.prototype.verifyPrimaryKey = async function(date=new Date(), userId={}) {
+Key.prototype.verifyPrimaryKey = async function(date = new Date(), userId = {}) {
   const primaryKey = this.keyPacket;
   // check for key revocation signatures
   if (await this.isRevoked(null, null, date)) {
@@ -538,7 +538,7 @@ Key.prototype.getExpirationTime = async function(capabilities, keyId, userId) {
  *                    selfCertification: module:packet.Signature}>} The primary user and the self signature
  * @async
  */
-Key.prototype.getPrimaryUser = async function(date=new Date(), userId={}) {
+Key.prototype.getPrimaryUser = async function(date = new Date(), userId = {}) {
   const primaryKey = this.keyPacket;
   const users = [];
   for (let i = 0; i < this.users.length; i++) {
@@ -681,9 +681,9 @@ async function mergeSignatures(source, dest, attr, checkFn) {
  * @async
  */
 Key.prototype.revoke = async function({
-  flag: reasonForRevocationFlag=enums.reasonForRevocation.no_reason,
-  string: reasonForRevocationString=''
-} = {}, date=new Date()) {
+  flag: reasonForRevocationFlag = enums.reasonForRevocation.no_reason,
+  string: reasonForRevocationString = ''
+} = {}, date = new Date()) {
   if (this.isPublic()) {
     throw new Error('Need private key for revoking');
   }
@@ -904,7 +904,7 @@ User.prototype.sign = async function(primaryKey, privateKeys) {
  * @returns {Promise<Boolean>}                      True if the certificate is revoked
  * @async
  */
-User.prototype.isRevoked = async function(primaryKey, certificate, key, date=new Date()) {
+User.prototype.isRevoked = async function(primaryKey, certificate, key, date = new Date()) {
   return isDataRevoked(
     primaryKey, enums.signature.cert_revocation, {
       key: primaryKey,
@@ -925,7 +925,7 @@ User.prototype.isRevoked = async function(primaryKey, certificate, key, date=new
  * @param  {Object} detached                 (optional) whether to create a detached signature packet
  * @returns {module:packet/signature}         signature packet
  */
-export async function createSignaturePacket(dataToSign, privateKey, signingKeyPacket, signatureProperties, date, userId, detached=false) {
+export async function createSignaturePacket(dataToSign, privateKey, signingKeyPacket, signatureProperties, date, userId, detached = false) {
   if (!signingKeyPacket.isDecrypted()) {
     throw new Error('Private key is not decrypted.');
   }
@@ -947,7 +947,7 @@ export async function createSignaturePacket(dataToSign, privateKey, signingKeyPa
  * @returns {Promise<module:enums.keyStatus>}     status of the certificate
  * @async
  */
-User.prototype.verifyCertificate = async function(primaryKey, certificate, keys, date=new Date()) {
+User.prototype.verifyCertificate = async function(primaryKey, certificate, keys, date = new Date()) {
   const that = this;
   const keyid = certificate.issuerKeyId;
   const dataToVerify = {
@@ -982,7 +982,7 @@ User.prototype.verifyCertificate = async function(primaryKey, certificate, keys,
  *                          valid: Boolean}>>}   List of signer's keyid and validity of signature
  * @async
  */
-User.prototype.verifyAllCertifications = async function(primaryKey, keys, date=new Date()) {
+User.prototype.verifyAllCertifications = async function(primaryKey, keys, date = new Date()) {
   const that = this;
   const certifications = this.selfCertifications.concat(this.otherCertifications);
   return Promise.all(certifications.map(async function(certification) {
@@ -1003,7 +1003,7 @@ User.prototype.verifyAllCertifications = async function(primaryKey, keys, date=n
  * @returns {Promise<module:enums.keyStatus>}    Status of user
  * @async
  */
-User.prototype.verify = async function(primaryKey, date=new Date()) {
+User.prototype.verify = async function(primaryKey, date = new Date()) {
   if (!this.selfCertifications.length) {
     return enums.keyStatus.no_self_cert;
   }
@@ -1101,7 +1101,7 @@ SubKey.prototype.toPacketlist = function() {
  * @returns {Promise<Boolean>}                      True if the binding signature is revoked
  * @async
  */
-SubKey.prototype.isRevoked = async function(primaryKey, signature, key, date=new Date()) {
+SubKey.prototype.isRevoked = async function(primaryKey, signature, key, date = new Date()) {
   return isDataRevoked(
     primaryKey, enums.signature.subkey_revocation, {
       key: primaryKey,
@@ -1119,7 +1119,7 @@ SubKey.prototype.isRevoked = async function(primaryKey, signature, key, date=new
  * @returns {Promise<module:enums.keyStatus>}    The status of the subkey
  * @async
  */
-SubKey.prototype.verify = async function(primaryKey, date=new Date()) {
+SubKey.prototype.verify = async function(primaryKey, date = new Date()) {
   const that = this;
   const dataToVerify = { key: primaryKey, bind: this.keyPacket };
   // check subkey binding signatures
@@ -1148,7 +1148,7 @@ SubKey.prototype.verify = async function(primaryKey, date=new Date()) {
  * @returns {Promise<Date | Infinity | null>}
  * @async
  */
-SubKey.prototype.getExpirationTime = async function(primaryKey, date=new Date()) {
+SubKey.prototype.getExpirationTime = async function(primaryKey, date = new Date()) {
   const dataToVerify = { key: primaryKey, bind: this.keyPacket };
   const bindingSignature = await getLatestValidSignature(this.bindingSignatures, primaryKey, enums.signature.subkey_binding, dataToVerify, date);
   if (!bindingSignature) return null;
@@ -1211,9 +1211,9 @@ SubKey.prototype.update = async function(subKey, primaryKey) {
  * @async
  */
 SubKey.prototype.revoke = async function(primaryKey, {
-  flag: reasonForRevocationFlag=enums.reasonForRevocation.no_reason,
-  string: reasonForRevocationString=''
-} = {}, date=new Date()) {
+  flag: reasonForRevocationFlag = enums.reasonForRevocation.no_reason,
+  string: reasonForRevocationString = ''
+} = {}, date = new Date()) {
   const dataToSign = { key: primaryKey, bind: this.keyPacket };
   const subKey = new SubKey(this.keyPacket);
   subKey.revocationSignatures.push(await createSignaturePacket(dataToSign, null, primaryKey, {
@@ -1328,7 +1328,7 @@ export async function generate(options) {
   promises = promises.concat(options.subkeys.map(generateSecretSubkey));
   return Promise.all(promises).then(packets => wrapKeyObject(packets[0], packets.slice(1), options));
 
-  function sanitizeKeyOptions(options, subkeyDefaults={}) {
+  function sanitizeKeyOptions(options, subkeyDefaults = {}) {
     options.curve = options.curve || subkeyDefaults.curve;
     options.numBits = options.numBits || subkeyDefaults.numBits;
     options.keyExpirationTime = options.keyExpirationTime !== undefined ? options.keyExpirationTime : subkeyDefaults.keyExpirationTime;
@@ -1344,19 +1344,12 @@ export async function generate(options) {
         throw new Error('Not valid curve.');
       }
       if (options.curve === enums.curve.ed25519 || options.curve === enums.curve.curve25519) {
-        if (options.sign) {
-          options.algorithm = enums.publicKey.eddsa;
-          options.curve = enums.curve.ed25519;
-        } else {
-          options.algorithm = enums.publicKey.ecdh;
-          options.curve = enums.curve.curve25519;
-        }
+        options.curve = options.sign ? enums.curve.ed25519 : enums.curve.curve25519;
+      }
+      if (options.sign) {
+        options.algorithm = options.curve === enums.curve.ed25519 ? enums.publicKey.eddsa : enums.publicKey.ecdsa;
       } else {
-        if (options.sign) {
-          options.algorithm = enums.publicKey.ecdsa;
-        } else {
-          options.algorithm = enums.publicKey.ecdh;
-        }
+        options.algorithm = enums.publicKey.ecdh;
       }
     } else if (options.numBits) {
       options.algorithm = enums.publicKey.rsa_encrypt_sign;
@@ -1441,7 +1434,7 @@ export async function reformat(options) {
 
   return wrapKeyObject(secretKeyPacket, secretSubkeyPackets, options);
 
-  function sanitizeKeyOptions(options, subkeyDefaults={}) {
+  function sanitizeKeyOptions(options, subkeyDefaults = {}) {
     options.keyExpirationTime = options.keyExpirationTime || subkeyDefaults.keyExpirationTime;
     options.passphrase = util.isString(options.passphrase) ? options.passphrase : subkeyDefaults.passphrase;
     options.date = options.date || subkeyDefaults.date;
@@ -1615,7 +1608,7 @@ async function wrapKeyObject(secretKeyPacket, secretSubkeyPackets, options) {
  * @returns {Promise<Boolean>}                      True if the signature revokes the data
  * @async
  */
-async function isDataRevoked(primaryKey, signatureType, dataToVerify, revocations, signature, key, date=new Date()) {
+async function isDataRevoked(primaryKey, signatureType, dataToVerify, revocations, signature, key, date = new Date()) {
   key = key || primaryKey;
   const normDate = util.normalizeDate(date);
   const revocationKeyIds = [];
@@ -1648,7 +1641,7 @@ async function isDataRevoked(primaryKey, signatureType, dataToVerify, revocation
   return revocationKeyIds.length > 0;
 }
 
-function isDataExpired(keyPacket, signature, date=new Date()) {
+function isDataExpired(keyPacket, signature, date = new Date()) {
   const normDate = util.normalizeDate(date);
   if (normDate !== null) {
     const expirationTime = getExpirationTime(keyPacket, signature);
@@ -1662,7 +1655,7 @@ function getExpirationTime(keyPacket, signature) {
   let expirationTime;
   // check V4 expiration time
   if (signature.keyNeverExpires === false) {
-    expirationTime = keyPacket.created.getTime() + signature.keyExpirationTime*1000;
+    expirationTime = keyPacket.created.getTime() + signature.keyExpirationTime * 1000;
   }
   return expirationTime ? new Date(expirationTime) : Infinity;
 }
@@ -1689,7 +1682,7 @@ function checkRevocationKey(signature, keyId) {
  * @returns {Promise<String>}
  * @async
  */
-export async function getPreferredHashAlgo(key, keyPacket, date=new Date(), userId={}) {
+export async function getPreferredHashAlgo(key, keyPacket, date = new Date(), userId = {}) {
   let hash_algo = config.prefer_hash_algorithm;
   let pref_algo = hash_algo;
   if (key instanceof Key) {
@@ -1725,7 +1718,7 @@ export async function getPreferredHashAlgo(key, keyPacket, date=new Date(), user
  * @returns {Promise<module:enums.symmetric>}   Preferred symmetric algorithm
  * @async
  */
-export async function getPreferredAlgo(type, keys, date=new Date(), userIds=[]) {
+export async function getPreferredAlgo(type, keys, date = new Date(), userIds = []) {
   const prefProperty = type === 'symmetric' ? 'preferredSymmetricAlgorithms' : 'preferredAeadAlgorithms';
   const defaultAlgo = type === 'symmetric' ? enums.symmetric.aes128 : enums.aead.eax;
   const prioMap = {};
@@ -1763,7 +1756,7 @@ export async function getPreferredAlgo(type, keys, date=new Date(), userIds=[])
  * @returns {Promise<Boolean>}
  * @async
  */
-export async function isAeadSupported(keys, date=new Date(), userIds=[]) {
+export async function isAeadSupported(keys, date = new Date(), userIds = []) {
   let supported = true;
   // TODO replace when Promise.some or Promise.any are implemented
   await Promise.all(keys.map(async function(key, i) {
diff --git a/src/message.js b/src/message.js
index 5b2bc51c..f57e82f2 100644
--- a/src/message.js
+++ b/src/message.js
@@ -285,7 +285,7 @@ Message.prototype.getText = function() {
  * @returns {Promise<Message>}                   new message with encrypted content
  * @async
  */
-Message.prototype.encrypt = async function(keys, passwords, sessionKey, wildcard=false, date=new Date(), userIds=[], streaming) {
+Message.prototype.encrypt = async function(keys, passwords, sessionKey, wildcard = false, date = new Date(), userIds = [], streaming) {
   let symAlgo;
   let aeadAlgo;
   let symEncryptedPacket;
@@ -352,7 +352,7 @@ Message.prototype.encrypt = async function(keys, passwords, sessionKey, wildcard
  * @returns {Promise<Message>}          new message with encrypted content
  * @async
  */
-export async function encryptSessionKey(sessionKey, symAlgo, aeadAlgo, publicKeys, passwords, wildcard=false, date=new Date(), userIds=[]) {
+export async function encryptSessionKey(sessionKey, symAlgo, aeadAlgo, publicKeys, passwords, wildcard = false, date = new Date(), userIds = []) {
   const packetlist = new packet.List();
 
   if (publicKeys) {
@@ -421,7 +421,7 @@ export async function encryptSessionKey(sessionKey, symAlgo, aeadAlgo, publicKey
  * @returns {Promise<Message>}             new message with signed content
  * @async
  */
-Message.prototype.sign = async function(privateKeys=[], signature=null, date=new Date(), userIds=[]) {
+Message.prototype.sign = async function(privateKeys = [], signature = null, date = new Date(), userIds = []) {
   const packetlist = new packet.List();
 
   const literalDataPacket = this.packets.findPacket(enums.packet.literal);
@@ -508,7 +508,7 @@ Message.prototype.compress = function(compression) {
  * @returns {Promise<module:signature.Signature>} new detached signature of message content
  * @async
  */
-Message.prototype.signDetached = async function(privateKeys=[], signature=null, date=new Date(), userIds=[]) {
+Message.prototype.signDetached = async function(privateKeys = [], signature = null, date = new Date(), userIds = []) {
   const literalDataPacket = this.packets.findPacket(enums.packet.literal);
   if (!literalDataPacket) {
     throw new Error('No literal data packet to sign.');
@@ -527,7 +527,7 @@ Message.prototype.signDetached = async function(privateKeys=[], signature=null,
  * @returns {Promise<module:packet.List>} list of signature packets
  * @async
  */
-export async function createSignaturePackets(literalDataPacket, privateKeys, signature=null, date=new Date(), userIds=[], detached=false) {
+export async function createSignaturePackets(literalDataPacket, privateKeys, signature = null, date = new Date(), userIds = [], detached = false) {
   const packetlist = new packet.List();
 
   // If data packet was created from Uint8Array, use binary, otherwise use text
@@ -564,7 +564,7 @@ export async function createSignaturePackets(literalDataPacket, privateKeys, sig
  * @returns {Promise<Array<({keyid: module:type/keyid, valid: Boolean})>>} list of signer's keyid and validity of signature
  * @async
  */
-Message.prototype.verify = async function(keys, date=new Date(), streaming) {
+Message.prototype.verify = async function(keys, date = new Date(), streaming) {
   const msg = this.unwrapCompressed();
   const literalDataList = msg.packets.filterByTag(enums.packet.literal);
   if (literalDataList.length !== 1) {
@@ -612,7 +612,7 @@ Message.prototype.verify = async function(keys, date=new Date(), streaming) {
  * @returns {Promise<Array<({keyid: module:type/keyid, valid: Boolean})>>} list of signer's keyid and validity of signature
  * @async
  */
-Message.prototype.verifyDetached = function(signature, keys, date=new Date()) {
+Message.prototype.verifyDetached = function(signature, keys, date = new Date()) {
   const msg = this.unwrapCompressed();
   const literalDataList = msg.packets.filterByTag(enums.packet.literal);
   if (literalDataList.length !== 1) {
@@ -634,7 +634,7 @@ Message.prototype.verifyDetached = function(signature, keys, date=new Date()) {
  *                          valid: Boolean}>>} list of signer's keyid and validity of signature
  * @async
  */
-async function createVerificationObject(signature, literalDataList, keys, date=new Date(), detached=false) {
+async function createVerificationObject(signature, literalDataList, keys, date = new Date(), detached = false) {
   let primaryKey = null;
   let signingKey = null;
   await Promise.all(keys.map(async function(key) {
@@ -696,7 +696,7 @@ async function createVerificationObject(signature, literalDataList, keys, date=n
  *                          valid: Boolean}>>} list of signer's keyid and validity of signature
  * @async
  */
-export async function createVerificationObjects(signatureList, literalDataList, keys, date=new Date(), detached=false) {
+export async function createVerificationObjects(signatureList, literalDataList, keys, date = new Date(), detached = false) {
   return Promise.all(signatureList.filter(function(signature) {
     return ['text', 'binary'].includes(enums.read(enums.signature, signature.signatureType));
   }).map(async function(signature) {
@@ -758,7 +758,7 @@ export async function readArmored(armoredText) {
  * @async
  * @static
  */
-export async function read(input, fromStream=util.isStream(input)) {
+export async function read(input, fromStream = util.isStream(input)) {
   const streamType = util.isStream(input);
   if (streamType === 'node') {
     input = stream.nodeToWeb(input);
@@ -779,7 +779,7 @@ export async function read(input, fromStream=util.isStream(input)) {
  * @returns {module:message.Message} new message object
  * @static
  */
-export function fromText(text, filename, date=new Date(), type='utf8') {
+export function fromText(text, filename, date = new Date(), type = 'utf8') {
   const streamType = util.isStream(text);
   if (streamType === 'node') {
     text = stream.nodeToWeb(text);
@@ -806,7 +806,7 @@ export function fromText(text, filename, date=new Date(), type='utf8') {
  * @returns {module:message.Message} new message object
  * @static
  */
-export function fromBinary(bytes, filename, date=new Date(), type='binary') {
+export function fromBinary(bytes, filename, date = new Date(), type = 'binary') {
   const streamType = util.isStream(bytes);
   if (!util.isUint8Array(bytes) && !streamType) {
     throw new Error('Data must be in the form of a Uint8Array or Stream');
diff --git a/src/openpgp.js b/src/openpgp.js
index 4d10c8a6..7c5fbc26 100644
--- a/src/openpgp.js
+++ b/src/openpgp.js
@@ -66,7 +66,7 @@ let asyncProxy; // instance of the asyncproxy
  * @returns {Promise<Boolean>}     returns a promise that resolves to true if all workers have succesfully finished loading
  * @async
  */
-export async function initWorker({ path='openpgp.worker.js', n = 1, workers = [] } = {}) {
+export async function initWorker({ path = 'openpgp.worker.js', n = 1, workers = [] } = {}) {
   if (workers.length || (typeof window !== 'undefined' && window.Worker && window.MessageChannel)) {
     const proxy = new AsyncProxy({ path, n, workers, config });
     const loaded = await proxy.loaded();
@@ -119,7 +119,7 @@ export function destroyWorker() {
  * @static
  */
 
-export function generateKey({ userIds=[], passphrase="", numBits=2048, keyExpirationTime=0, curve="", date=new Date(), subkeys=[{}] }) {
+export function generateKey({ userIds = [], passphrase = "", numBits = 2048, keyExpirationTime = 0, curve = "", date = new Date(), subkeys = [{}] }) {
   userIds = toArray(userIds);
   const options = { userIds, passphrase, numBits, keyExpirationTime, curve, date, subkeys };
   if (util.getWebCryptoAll() && numBits < 2048) {
@@ -157,7 +157,7 @@ export function generateKey({ userIds=[], passphrase="", numBits=2048, keyExpira
  * @async
  * @static
  */
-export function reformatKey({ privateKey, userIds=[], passphrase="", keyExpirationTime=0, date, revocationCertificate=true }) {
+export function reformatKey({ privateKey, userIds = [], passphrase = "", keyExpirationTime = 0, date, revocationCertificate = true }) {
   userIds = toArray(userIds);
   const options = { privateKey, userIds, passphrase, keyExpirationTime, date, revocationCertificate };
   if (asyncProxy) {
@@ -309,7 +309,7 @@ export function encryptKey({ privateKey, passphrase }) {
  * @async
  * @static
  */
-export function encrypt({ message, publicKeys, privateKeys, passwords, sessionKey, compression=config.compression, armor=true, streaming=message&&message.fromStream, detached=false, signature=null, returnSessionKey=false, wildcard=false, date=new Date(), fromUserIds=[], toUserIds=[] }) {
+export function encrypt({ message, publicKeys, privateKeys, passwords, sessionKey, compression = config.compression, armor = true, streaming = message && message.fromStream, detached = false, signature = null, returnSessionKey = false, wildcard = false, date = new Date(), fromUserIds = [], toUserIds = [] }) {
   checkMessage(message); publicKeys = toArray(publicKeys); privateKeys = toArray(privateKeys); passwords = toArray(passwords); fromUserIds = toArray(fromUserIds); toUserIds = toArray(toUserIds);
 
   if (!nativeAEAD() && asyncProxy) { // use web worker if web crypto apis are not supported
@@ -373,7 +373,7 @@ export function encrypt({ message, publicKeys, privateKeys, passwords, sessionKe
  * @async
  * @static
  */
-export function decrypt({ message, privateKeys, passwords, sessionKeys, publicKeys, format='utf8', streaming=message&&message.fromStream, signature=null, date=new Date() }) {
+export function decrypt({ message, privateKeys, passwords, sessionKeys, publicKeys, format = 'utf8', streaming = message && message.fromStream, signature = null, date = new Date() }) {
   checkMessage(message); publicKeys = toArray(publicKeys); privateKeys = toArray(privateKeys); passwords = toArray(passwords); sessionKeys = toArray(sessionKeys);
 
   if (!nativeAEAD() && asyncProxy) { // use web worker if web crypto apis are not supported
@@ -429,7 +429,7 @@ export function decrypt({ message, privateKeys, passwords, sessionKeys, publicKe
  * @async
  * @static
  */
-export function sign({ message, privateKeys, armor=true, streaming=message&&message.fromStream, detached=false, date=new Date(), fromUserIds=[] }) {
+export function sign({ message, privateKeys, armor = true, streaming = message && message.fromStream, detached = false, date = new Date(), fromUserIds = [] }) {
   checkCleartextOrMessage(message);
   privateKeys = toArray(privateKeys); fromUserIds = toArray(fromUserIds);
 
@@ -487,7 +487,7 @@ export function sign({ message, privateKeys, armor=true, streaming=message&&mess
  * @async
  * @static
  */
-export function verify({ message, publicKeys, streaming=message&&message.fromStream, signature=null, date=new Date() }) {
+export function verify({ message, publicKeys, streaming = message && message.fromStream, signature = null, date = new Date() }) {
   checkCleartextOrMessage(message);
   publicKeys = toArray(publicKeys);
 
@@ -529,7 +529,7 @@ export function verify({ message, publicKeys, streaming=message&&message.fromStr
  * @async
  * @static
  */
-export function encryptSessionKey({ data, algorithm, aeadAlgorithm, publicKeys, passwords, wildcard=false, date=new Date(), toUserIds=[] }) {
+export function encryptSessionKey({ data, algorithm, aeadAlgorithm, publicKeys, passwords, wildcard = false, date = new Date(), toUserIds = [] }) {
   checkBinary(data); checkString(algorithm, 'algorithm'); publicKeys = toArray(publicKeys); passwords = toArray(passwords); toUserIds = toArray(toUserIds);
 
   if (asyncProxy) { // use web worker if available
@@ -644,7 +644,7 @@ async function convertStream(data, streaming) {
  * @param  {Array<String>} keys            (optional) which keys to return as streams, if possible
  * @returns {Object}                       the data in the respective format
  */
-async function convertStreams(obj, streaming, keys=[]) {
+async function convertStreams(obj, streaming, keys = []) {
   if (Object.prototype.isPrototypeOf(obj) && !Uint8Array.prototype.isPrototypeOf(obj)) {
     await Promise.all(Object.entries(obj).map(async ([key, value]) => { // recursively search all children
       if (util.isStream(value) || keys.includes(key)) {
diff --git a/src/packet/literal.js b/src/packet/literal.js
index 6750da4a..3e7e5ef5 100644
--- a/src/packet/literal.js
+++ b/src/packet/literal.js
@@ -35,7 +35,7 @@ import util from '../util';
  * @memberof module:packet
  * @constructor
  */
-function Literal(date=new Date()) {
+function Literal(date = new Date()) {
   this.tag = enums.packet.literal;
   this.format = 'utf8'; // default format for literal data packets
   this.date = util.normalizeDate(date);
@@ -50,7 +50,7 @@ function Literal(date=new Date()) {
  * @param {String | ReadableStream<String>} text Any native javascript string
  * @param {utf8|binary|text|mime} format (optional) The format of the string of bytes
  */
-Literal.prototype.setText = function(text, format='utf8') {
+Literal.prototype.setText = function(text, format = 'utf8') {
   this.format = format;
   this.text = text;
   this.data = null;
@@ -62,7 +62,7 @@ Literal.prototype.setText = function(text, format='utf8') {
  * @param {Boolean} clone (optional) Whether to return a clone so that getBytes/getText can be called again
  * @returns {String | ReadableStream<String>} literal data as text
  */
-Literal.prototype.getText = function(clone=false) {
+Literal.prototype.getText = function(clone = false) {
   if (this.text === null || util.isStream(this.text)) { // Assume that this.text has been read
     this.text = util.nativeEOL(util.decode_utf8(this.getBytes(clone)));
   }
@@ -86,7 +86,7 @@ Literal.prototype.setBytes = function(bytes, format) {
  * @param {Boolean} clone (optional) Whether to return a clone so that getBytes/getText can be called again
  * @returns {Uint8Array | ReadableStream<Uint8Array>} A sequence of bytes
  */
-Literal.prototype.getBytes = function(clone=false) {
+Literal.prototype.getBytes = function(clone = false) {
   if (this.data === null) {
     // normalize EOL to \r\n and encode UTF8
     this.data = util.encode_utf8(util.canonicalizeEOL(this.text));
diff --git a/src/packet/public_key.js b/src/packet/public_key.js
index ec743da0..6d89e09f 100644
--- a/src/packet/public_key.js
+++ b/src/packet/public_key.js
@@ -46,7 +46,7 @@ import util from '../util';
  * @memberof module:packet
  * @constructor
  */
-function PublicKey(date=new Date()) {
+function PublicKey(date = new Date()) {
   /**
    * Packet type
    * @type {module:enums.packet}
diff --git a/src/packet/public_subkey.js b/src/packet/public_subkey.js
index f0cd02e4..4472d088 100644
--- a/src/packet/public_subkey.js
+++ b/src/packet/public_subkey.js
@@ -20,7 +20,7 @@
  * @requires enums
  */
 
-import publicKey from './public_key';
+import PublicKey from './public_key';
 import enums from '../enums';
 
 /**
@@ -34,11 +34,11 @@ import enums from '../enums';
  * @extends module:packet.PublicKey
  */
 function PublicSubkey() {
-  publicKey.call(this);
+  PublicKey.call(this);
   this.tag = enums.packet.publicSubkey;
 }
 
-PublicSubkey.prototype = new publicKey();
+PublicSubkey.prototype = new PublicKey();
 PublicSubkey.prototype.constructor = PublicSubkey;
 
 export default PublicSubkey;
diff --git a/src/packet/secret_key.js b/src/packet/secret_key.js
index 6fd38b1f..10b22814 100644
--- a/src/packet/secret_key.js
+++ b/src/packet/secret_key.js
@@ -24,7 +24,7 @@
  * @requires util
  */
 
-import publicKey from './public_key';
+import PublicKey from './public_key';
 import type_keyid from '../type/keyid.js';
 import type_s2k from '../type/s2k';
 import crypto from '../crypto';
@@ -39,8 +39,8 @@ import util from '../util';
  * @constructor
  * @extends module:packet.PublicKey
  */
-function SecretKey(date=new Date()) {
-  publicKey.call(this, date);
+function SecretKey(date = new Date()) {
+  PublicKey.call(this, date);
   /**
    * Packet type
    * @type {module:enums.packet}
@@ -76,7 +76,7 @@ function SecretKey(date=new Date()) {
   this.aead = 'eax';
 }
 
-SecretKey.prototype = new publicKey();
+SecretKey.prototype = new PublicKey();
 SecretKey.prototype.constructor = SecretKey;
 
 // Helper function
diff --git a/src/packet/secret_subkey.js b/src/packet/secret_subkey.js
index e6f2ac4d..824b77b3 100644
--- a/src/packet/secret_subkey.js
+++ b/src/packet/secret_subkey.js
@@ -20,7 +20,7 @@
  * @requires enums
  */
 
-import secretKey from './secret_key';
+import SecretKey from './secret_key';
 import enums from '../enums';
 
 /**
@@ -30,12 +30,12 @@ import enums from '../enums';
  * @constructor
  * @extends module:packet.SecretKey
  */
-function SecretSubkey(date=new Date()) {
-  secretKey.call(this, date);
+function SecretSubkey(date = new Date()) {
+  SecretKey.call(this, date);
   this.tag = enums.packet.secretSubkey;
 }
 
-SecretSubkey.prototype = new secretKey();
+SecretSubkey.prototype = new SecretKey();
 SecretSubkey.prototype.constructor = SecretSubkey;
 
 export default SecretSubkey;
diff --git a/src/packet/signature.js b/src/packet/signature.js
index e425cef5..84de671c 100644
--- a/src/packet/signature.js
+++ b/src/packet/signature.js
@@ -45,7 +45,7 @@ import config from '../config';
  * @constructor
  * @param {Date} date the creation date of the signature
  */
-function Signature(date=new Date()) {
+function Signature(date = new Date()) {
   this.tag = enums.packet.signature;
   this.version = 4; // This is set to 5 below if we sign with a V5 key.
   this.signatureType = null;
@@ -152,7 +152,7 @@ Signature.prototype.write = function () {
  * @returns {Promise<Boolean>}
  * @async
  */
-Signature.prototype.sign = async function (key, data, detached=false) {
+Signature.prototype.sign = async function (key, data, detached = false) {
   const signatureType = enums.write(enums.signature, this.signatureType);
   const publicKeyAlgorithm = enums.write(enums.publicKey, this.publicKeyAlgorithm);
   const hashAlgorithm = enums.write(enums.hash, this.hashAlgorithm);
@@ -347,7 +347,7 @@ function write_sub_packet(type, data) {
 
 // V4 signature sub packets
 
-Signature.prototype.read_sub_packet = function (bytes, trusted=true) {
+Signature.prototype.read_sub_packet = function (bytes, trusted = true) {
   let mypos = 0;
 
   const read_array = (prop, bytes) => {
@@ -456,7 +456,7 @@ Signature.prototype.read_sub_packet = function (bytes, trusted=true) {
           throw new Error("Unknown critical notation: " + name);
         }
       } else {
-        util.print_debug("Unsupported notation flag "+bytes[mypos]);
+        util.print_debug("Unsupported notation flag " + bytes[mypos]);
       }
       break;
     case 21:
@@ -541,7 +541,7 @@ Signature.prototype.read_sub_packet = function (bytes, trusted=true) {
   }
 };
 
-Signature.prototype.read_sub_packets = function(bytes, trusted=true) {
+Signature.prototype.read_sub_packets = function(bytes, trusted = true) {
   // Two-octet scalar octet count for following subpacket data.
   const subpacket_length = util.readNumber(bytes.subarray(0, 2));
 
@@ -657,13 +657,13 @@ Signature.prototype.calculateTrailer = function (data, detached) {
 };
 
 
-Signature.prototype.toHash = function(signatureType, data, detached=false) {
+Signature.prototype.toHash = function(signatureType, data, detached = false) {
   const bytes = this.toSign(signatureType, data);
 
   return util.concat([bytes, this.signatureData, this.calculateTrailer(data, detached)]);
 };
 
-Signature.prototype.hash = async function(signatureType, data, toHash, detached=false, streaming=true) {
+Signature.prototype.hash = async function(signatureType, data, toHash, detached = false, streaming = true) {
   const hashAlgorithm = enums.write(enums.hash, this.hashAlgorithm);
   if (!toHash) toHash = this.toHash(signatureType, data, detached);
   if (!streaming && util.isStream(toHash)) {
@@ -683,7 +683,7 @@ Signature.prototype.hash = async function(signatureType, data, toHash, detached=
  * @returns {Promise<Boolean>} True if message is verified, else false.
  * @async
  */
-Signature.prototype.verify = async function (key, signatureType, data, detached=false) {
+Signature.prototype.verify = async function (key, signatureType, data, detached = false) {
   const publicKeyAlgorithm = enums.write(enums.publicKey, this.publicKeyAlgorithm);
   const hashAlgorithm = enums.write(enums.hash, this.hashAlgorithm);
 
@@ -744,7 +744,7 @@ Signature.prototype.verify = async function (key, signatureType, data, detached=
  * @param {Date} date (optional) use the given date for verification instead of the current time
  * @returns {Boolean} true if expired
  */
-Signature.prototype.isExpired = function (date=new Date()) {
+Signature.prototype.isExpired = function (date = new Date()) {
   const normDate = util.normalizeDate(date);
   if (normDate !== null) {
     const expirationTime = this.getExpirationTime();
@@ -758,7 +758,7 @@ Signature.prototype.isExpired = function (date=new Date()) {
  * @returns {Date} expiration time
  */
 Signature.prototype.getExpirationTime = function () {
-  return !this.signatureNeverExpires ? new Date(this.created.getTime() + this.signatureExpirationTime*1000) : Infinity;
+  return !this.signatureNeverExpires ? new Date(this.created.getTime() + this.signatureExpirationTime * 1000) : Infinity;
 };
 
 /**
diff --git a/src/type/ecdh_symkey.js b/src/type/ecdh_symkey.js
index 6cd86631..08c961f9 100644
--- a/src/type/ecdh_symkey.js
+++ b/src/type/ecdh_symkey.js
@@ -46,9 +46,9 @@ function ECDHSymmetricKey(data) {
 ECDHSymmetricKey.prototype.read = function (input) {
   if (input.length >= 1) {
     const length = input[0];
-    if (input.length >= 1+length) {
-      this.data = input.subarray(1, 1+length);
-      return 1+this.data.length;
+    if (input.length >= 1 + length) {
+      this.data = input.subarray(1, 1 + length);
+      return 1 + this.data.length;
     }
   }
   throw new Error('Invalid symmetric key');
diff --git a/src/type/keyid.js b/src/type/keyid.js
index d962b30b..a393b02b 100644
--- a/src/type/keyid.js
+++ b/src/type/keyid.js
@@ -57,7 +57,7 @@ Keyid.prototype.toHex = function() {
  * @param {Keyid} keyid
  * @param {Boolean} matchWildcard Indicates whether to check if either keyid is a wildcard
  */
-Keyid.prototype.equals = function(keyid, matchWildcard=false) {
+Keyid.prototype.equals = function(keyid, matchWildcard = false) {
   return (matchWildcard && (keyid.isWildcard() || this.isWildcard())) || this.bytes === keyid.bytes;
 };
 
diff --git a/src/type/mpi.js b/src/type/mpi.js
index 69db5980..ab9502df 100644
--- a/src/type/mpi.js
+++ b/src/type/mpi.js
@@ -60,7 +60,7 @@ function MPI(data) {
  * @param {String}     endian Endianness of the data; 'be' for big-endian or 'le' for little-endian
  * @returns {Integer}          Length of data read
  */
-MPI.prototype.read = function (bytes, endian='be') {
+MPI.prototype.read = function (bytes, endian = 'be') {
   if (util.isString(bytes)) {
     bytes = util.str_to_Uint8Array(bytes);
   }
@@ -111,7 +111,7 @@ MPI.prototype.toUint8Array = function (endian, length) {
   return payload;
 };
 
-MPI.prototype.fromUint8Array = function (bytes, endian='be') {
+MPI.prototype.fromUint8Array = function (bytes, endian = 'be') {
   this.data = new Uint8Array(bytes.length);
   this.data.set(bytes);
 
@@ -124,7 +124,7 @@ MPI.prototype.toString = function () {
   return util.Uint8Array_to_str(this.toUint8Array());
 };
 
-MPI.prototype.fromString = function (str, endian='be') {
+MPI.prototype.fromString = function (str, endian = 'be') {
   this.fromUint8Array(util.str_to_Uint8Array(str), endian);
 };
 
diff --git a/src/type/oid.js b/src/type/oid.js
index 1422bd66..cc9efe99 100644
--- a/src/type/oid.js
+++ b/src/type/oid.js
@@ -66,9 +66,9 @@ function OID(oid) {
 OID.prototype.read = function (input) {
   if (input.length >= 1) {
     const length = input[0];
-    if (input.length >= 1+length) {
-      this.oid = input.subarray(1, 1+length);
-      return 1+this.oid.length;
+    if (input.length >= 1 + length) {
+      this.oid = input.subarray(1, 1 + length);
+      return 1 + this.oid.length;
     }
   }
   throw new Error('Invalid oid');
diff --git a/src/type/s2k.js b/src/type/s2k.js
index 99ea32ca..8359547d 100644
--- a/src/type/s2k.js
+++ b/src/type/s2k.js
@@ -188,7 +188,7 @@ S2K.prototype.produce_key = async function (passphrase, numBytes) {
   let rlength = 0;
   const prefix = new Uint8Array(numBytes);
 
-  for (let i = 0; i<numBytes; i++) {
+  for (let i = 0; i < numBytes; i++) {
     prefix[i] = 0;
   }
 
diff --git a/src/util.js b/src/util.js
index af226453..3cdfc94f 100644
--- a/src/util.js
+++ b/src/util.js
@@ -317,7 +317,7 @@ export default {
     const j = bytes.length;
 
     for (let i = 0; i < j; i += bs) {
-      result.push(String.fromCharCode.apply(String, bytes.subarray(i, i+bs < j ? i+bs : j)));
+      result.push(String.fromCharCode.apply(String, bytes.subarray(i, i + bs < j ? i + bs : j)));
     }
     return result.join('');
   },
@@ -330,7 +330,7 @@ export default {
   encode_utf8: function (str) {
     const encoder = new TextEncoder('utf-8');
     // eslint-disable-next-line no-inner-declarations
-    function process(value, lastChunk=false) {
+    function process(value, lastChunk = false) {
       return encoder.encode(value, { stream: !lastChunk });
     }
     return stream.transform(str, process, () => process('', true));
@@ -344,7 +344,7 @@ export default {
   decode_utf8: function (utf8) {
     const decoder = new TextDecoder('utf-8');
     // eslint-disable-next-line no-inner-declarations
-    function process(value, lastChunk=false) {
+    function process(value, lastChunk = false) {
       return decoder.decode(value, { stream: !lastChunk });
     }
     return stream.transform(utf8, process, () => process(new Uint8Array(), true));
diff --git a/src/worker/async_proxy.js b/src/worker/async_proxy.js
index ce809206..a5b97c37 100644
--- a/src/worker/async_proxy.js
+++ b/src/worker/async_proxy.js
@@ -42,7 +42,7 @@ import packet from '../packet';
  * @param {Array<Object>} worker   alternative to path parameter: web worker initialized with 'openpgp.worker.js'
  * @constructor
  */
-function AsyncProxy({ path='openpgp.worker.js', n = 1, workers = [], config } = {}) {
+function AsyncProxy({ path = 'openpgp.worker.js', n = 1, workers = [], config } = {}) {
   /**
    * Message handling
    */