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

This commit is contained in:
larabr 2022-03-14 21:40:16 +01:00 committed by GitHub
parent 2e867956eb
commit 36985c92dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 35 additions and 33 deletions

View File

@ -10,7 +10,8 @@ module.exports = {
},
"plugins": [
"chai-friendly"
"chai-friendly",
"import"
],
"globals": { // TODO are all these necessary?
@ -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",

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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,

View File

@ -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';

View File

@ -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';

View File

@ -20,7 +20,7 @@
* @private
*/
import util from '../util.js';
import util from '../util';
/**
* Implementation of type key id

View File

@ -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 {
/**