Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint: error if imported value not found in module #1507

Merged
merged 1 commit into from Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions .eslintrc.js
Expand Up @@ -10,7 +10,8 @@ module.exports = {
},

"plugins": [
"chai-friendly"
"chai-friendly",
"import"
],

"globals": { // TODO are all these necessary?
Expand Down Expand Up @@ -326,7 +327,8 @@ module.exports = {
"no-unused-vars": "error",

// eslint-plugin-import rules:
"import/extensions": "never",
"import/named": "error",
"import/extensions": "error",
"import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}],
"import/no-unassigned-import": "error",

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/cipher/index.js
Expand Up @@ -5,7 +5,7 @@
*/

import aes from './aes';
import { DES, TripleDES } from './des.js';
import { DES, TripleDES } from './des';
import CAST5 from './cast5';
import TF from './twofish';
import BF from './blowfish';
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/public_key/elliptic/curves.js
Expand Up @@ -21,7 +21,7 @@
* @private
*/

import nacl from '@openpgp/tweetnacl/nacl-fast-light.js';
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
import { getRandomBytes } from '../../random';
import enums from '../../../enums';
import util from '../../../util';
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/public_key/elliptic/ecdh.js
Expand Up @@ -21,7 +21,7 @@
* @private
*/

import nacl from '@openpgp/tweetnacl/nacl-fast-light.js';
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
import { Curve, jwkToRawPublic, rawPublicToJWK, privateToJWK, validateStandardParams } from './curves';
import * as aesKW from '../../aes_kw';
import { getRandomBytes } from '../../random';
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/public_key/elliptic/eddsa.js
Expand Up @@ -22,7 +22,7 @@
*/

import sha512 from 'hash.js/lib/hash/sha/512';
import nacl from '@openpgp/tweetnacl/nacl-fast-light.js';
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
import util from '../../../util';
import enums from '../../../enums';
import hash from '../../hash';
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/public_key/index.js
Expand Up @@ -4,7 +4,7 @@
* @private
*/

import nacl from '@openpgp/tweetnacl/nacl-fast-light.js';
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
import * as rsa from './rsa';
import * as elgamal from './elgamal';
import * as elliptic from './elliptic';
Expand Down
4 changes: 2 additions & 2 deletions src/encoding/armor.js
Expand Up @@ -16,8 +16,8 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

import * as stream from '@openpgp/web-stream-tools';
import * as base64 from './base64.js';
import enums from '../enums.js';
import * as base64 from './base64';
import enums from '../enums';
import util from '../util';
import defaultConfig from '../config';

Expand Down
6 changes: 3 additions & 3 deletions src/key/index.js
Expand Up @@ -14,9 +14,9 @@ import {
createSignaturePacket
} from './helper';

import PrivateKey from './private_key.js';
import PublicKey from './public_key.js';
import Subkey from './subkey.js';
import PrivateKey from './private_key';
import PublicKey from './public_key';
import Subkey from './subkey';

export {
readKey,
Expand Down
34 changes: 17 additions & 17 deletions src/packet/all_packets.js
Expand Up @@ -4,20 +4,20 @@
* @private
*/

export { default as CompressedDataPacket } from './compressed_data.js';
export { default as SymEncryptedIntegrityProtectedDataPacket } from './sym_encrypted_integrity_protected_data.js';
export { default as AEADEncryptedDataPacket } from './aead_encrypted_data.js';
export { default as PublicKeyEncryptedSessionKeyPacket } from './public_key_encrypted_session_key.js';
export { default as SymEncryptedSessionKeyPacket } from './sym_encrypted_session_key.js';
export { default as LiteralDataPacket } from './literal_data.js';
export { default as PublicKeyPacket } from './public_key.js';
export { default as SymmetricallyEncryptedDataPacket } from './symmetrically_encrypted_data.js';
export { default as MarkerPacket } from './marker.js';
export { default as PublicSubkeyPacket } from './public_subkey.js';
export { default as UserAttributePacket } from './user_attribute.js';
export { default as OnePassSignaturePacket } from './one_pass_signature.js';
export { default as SecretKeyPacket } from './secret_key.js';
export { default as UserIDPacket } from './userid.js';
export { default as SecretSubkeyPacket } from './secret_subkey.js';
export { default as SignaturePacket } from './signature.js';
export { default as TrustPacket } from './trust.js';
export { default as CompressedDataPacket } from './compressed_data';
export { default as SymEncryptedIntegrityProtectedDataPacket } from './sym_encrypted_integrity_protected_data';
export { default as AEADEncryptedDataPacket } from './aead_encrypted_data';
export { default as PublicKeyEncryptedSessionKeyPacket } from './public_key_encrypted_session_key';
export { default as SymEncryptedSessionKeyPacket } from './sym_encrypted_session_key';
export { default as LiteralDataPacket } from './literal_data';
export { default as PublicKeyPacket } from './public_key';
export { default as SymmetricallyEncryptedDataPacket } from './symmetrically_encrypted_data';
export { default as MarkerPacket } from './marker';
export { default as PublicSubkeyPacket } from './public_subkey';
export { default as UserAttributePacket } from './user_attribute';
export { default as OnePassSignaturePacket } from './one_pass_signature';
export { default as SecretKeyPacket } from './secret_key';
export { default as UserIDPacket } from './userid';
export { default as SecretSubkeyPacket } from './secret_subkey';
export { default as SignaturePacket } from './signature';
export { default as TrustPacket } from './trust';
2 changes: 1 addition & 1 deletion src/packet/signature.js
Expand Up @@ -17,7 +17,7 @@

import * as stream from '@openpgp/web-stream-tools';
import { readSimpleLength, UnsupportedError, writeSimpleLength } from './packet';
import KeyID from '../type/keyid.js';
import KeyID from '../type/keyid';
import crypto from '../crypto';
import enums from '../enums';
import util from '../util';
Expand Down
2 changes: 1 addition & 1 deletion src/type/keyid.js
Expand Up @@ -20,7 +20,7 @@
* @private
*/

import util from '../util.js';
import util from '../util';

/**
* Implementation of type key id
Expand Down
4 changes: 2 additions & 2 deletions src/type/s2k.js
Expand Up @@ -30,8 +30,8 @@

import defaultConfig from '../config';
import crypto from '../crypto';
import enums from '../enums.js';
import util from '../util.js';
import enums from '../enums';
import util from '../util';

class S2K {
/**
Expand Down