Skip to content

Commit

Permalink
Update linter to support explicit extensions, fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
larabr committed Nov 27, 2023
1 parent 0ba28d1 commit 1edf643
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 256 deletions.
8 changes: 6 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"sourceType": "module",
"project": "tsconfig.eslint.json"
},

"settings": {
"import/resolver": {
"typescript": { "alwaysTryTypes": true }
}
},
"globals": {
"window": "readonly",
"btoa": "readonly",
Expand Down Expand Up @@ -60,7 +64,7 @@
"import/no-extraneous-dependencies": "off",
"import/no-unassigned-import": "error",
"import/named": "error",
"import/extensions": "error",
"import/extensions": ["error", { "js": "ignorePackages" }],
"max-len": ["error", {
"ignoreComments": true,
"code": 120,
Expand Down
1 change: 0 additions & 1 deletion lib/key/check.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { enums } from '../openpgp.js';
import { serverTime } from '../serverTime.js';

/**
* Checks whether the primary key and the subkeys meet our recommended security requirements.
Expand Down
4 changes: 2 additions & 2 deletions lib/key/forwarding.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BigInteger as BigIntegerInterface } from '@openpgp/noble-hashes/biginteger';
import { KDFParams, PrivateKey, UserID, SecretSubkeyPacket, SecretKeyPacket, MaybeArray, Subkey, config as defaultConfig, SubkeyOptions, enums } from '../openpgp.js';
import { generateKey, reformatKey } from './utils.js';
import type { BigInteger as BigIntegerInterface } from '@openpgp/noble-hashes/biginteger';

let MaybeUninitializedBigInteger: typeof BigIntegerInterface;
const getBigInteger = async () => {
Expand All @@ -9,7 +9,7 @@ const getBigInteger = async () => {
// so we do the same here.
if (MaybeUninitializedBigInteger) return MaybeUninitializedBigInteger;

MaybeUninitializedBigInteger = await import('@openpgp/noble-hashes/biginteger').then(mod => mod.default);
MaybeUninitializedBigInteger = await import('@openpgp/noble-hashes/biginteger').then((mod) => mod.default);
return MaybeUninitializedBigInteger;
};

Expand Down
4 changes: 4 additions & 0 deletions lib/message/verify.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export function verifyMessage<DataType extends Data, FormatType extends VerifyOp
VerifyMessageResult<Uint8Array> :
never
>;
export function handleVerificationResult<DataType extends Data>(
verificationResult: openpgp_VerifyMessageResult<DataType>,
context: ContextVerificationOptions
): Promise<VerifyMessageResult<DataType>>;

export interface VerifyCleartextOptionsPmcrypto extends Omit<VerifyOptions, 'message' | 'signature' | 'format'> {
cleartextMessage: CleartextMessage
Expand Down
Loading

0 comments on commit 1edf643

Please sign in to comment.