Skip to content

Commit fdcfb45

Browse files
authored
chore: cleaning up linting and stricter CI (#821)
* chore: agent index linting fixes * stricter enforcement for lint CI * changelog
1 parent eb3fa49 commit fdcfb45

File tree

8 files changed

+16
-13
lines changed

8 files changed

+16
-13
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
node-version: ${{ matrix.node }}
2727
- run: npm install -g npm
2828
- run: npm install
29-
- run: npm run lint --workspaces --if-present
29+
- run: npm run lint --workspaces --if-present -- --max-warnings=0

docs/generated/changelog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ <h1>Agent-JS Changelog</h1>
1212
<section>
1313
<h2>Version x.x.x</h2>
1414
<ul>
15+
<li>chore: cleaning up lint warnings</li>
1516
<li>chore: cleans up github actions linting warnings</li>
1617
<li>feat: replaces `secp256k1` npm package with `@noble/curves`</li>
1718
<li>feat: enhances `.from` methods on public key classes to support unknown types, including PublicKey instances, ArrayBuffer-like objects, DER encoded public keys, and hex strings. Also introduces a new `bufFromBufLike` util</li>

e2e/browser/cypress/utils/actor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export { idlFactory } from '../../src/declarations/whoami/whoami.did.js';
88
/**
99
*
1010
* @param {string | import("@dfinity/principal").Principal} canisterId Canister ID of Agent
11-
* @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options]
12-
* @return {import("@dfinity/agent").ActorSubclass<import("./whoami.did.js")._SERVICE>}
11+
* @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options] - Options for creating the actor
12+
* @returns {import("@dfinity/agent").ActorSubclass<import("./whoami.did.js")._SERVICE>} - Actor
1313
*/
1414
export const createActor = (canisterId, options) => {
1515
const agent = new HttpAgent({ ...options?.agentOptions });

e2e/node/.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/*.d.ts
2+
**/*.js

packages/agent/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ export * from './utils/bls';
1515
export * from './utils/buffer';
1616
export * from './utils/random';
1717
export * as polling from './polling';
18+
import * as CanisterStatus from './canisterStatus';
19+
export * as CanisterStatus from './canisterStatus';
1820
/**
1921
* The CanisterStatus utility is used to request structured data directly from the IC public API. This data can be accessed using agent.readState, but CanisterStatus provides a helpful abstraction with some known paths.
2022
*
2123
* You can request a canisters Controllers, ModuleHash, Candid interface, Subnet, or Time, or provide a custom path {@link CanisterStatus.CustomPath} and pass arbitrary buffers for valid paths identified in https://internetcomputer.org/docs/current/references/ic-interface-spec.
2224
*
2325
* The primary method for this namespace is {@link CanisterStatus.request}
2426
*/
25-
export * as CanisterStatus from './canisterStatus';
2627

2728
import { Agent, HttpAgent } from './agent';
2829
import { IDL } from '@dfinity/candid';
@@ -37,7 +38,7 @@ export interface GlobalInternetComputer {
3738
/**
3839
* Simple advertisement of features in whoever is managing this `globalThis.ic`.
3940
* Use Case
40-
* * Scripts that know they need an ic feature can detect using this and, if not present
41+
* - Scripts that know they need an ic feature can detect using this and, if not present
4142
* (e.g. old bootstrap version), they can dynamically include their own and continue
4243
* operating (e.g. polyfill).
4344
* This is useful when adding features to bootstrap. You can still deploy your canister to

packages/auth-client/src/db.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ export type DBCreateOptions = {
6060
*/
6161
export class IdbKeyVal {
6262
/**
63-
*
64-
* @param {DBCreateOptions} options {@link DbCreateOptions}
63+
* @param {DBCreateOptions} options - DBCreateOptions
6564
* @param {DBCreateOptions['dbName']} options.dbName name for the indexeddb database
6665
* @default
6766
* @param {DBCreateOptions['storeName']} options.storeName name for the indexeddb Data Store

packages/auth-client/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ type AuthResponse = AuthResponseSuccess | AuthResponseFailure;
168168
export class AuthClient {
169169
/**
170170
* Create an AuthClient to manage authentication and identity
171-
* @constructs {@link AuthClient}
172-
* @param {AuthClientCreateOptions} options
171+
* @constructs
172+
* @param {AuthClientCreateOptions} options - Options for creating an {@link AuthClient}
173173
* @see {@link AuthClientCreateOptions}
174174
* @param options.identity Optional Identity to use as the base
175175
* @see {@link SignIdentity}
@@ -418,7 +418,7 @@ export class AuthClient {
418418
/**
419419
* AuthClient Login -
420420
* Opens up a new window to authenticate with Internet Identity
421-
* @param {AuthClientLoginOptions} options
421+
* @param {AuthClientLoginOptions} options - Options for logging in
422422
* @param options.identityProvider Identity provider
423423
* @param options.maxTimeToLive Expiration of the authentication in nanoseconds
424424
* @param options.derivationOrigin Origin for Identity Provider to use while generating the delegated identity

packages/identity/src/identity/ecdsa.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export class ECDSAKeyIdentity extends SignIdentity {
7474

7575
/**
7676
* generates an identity from a public and private key. Please ensure that you are generating these keys securely and protect the user's private key
77-
* @param keyPair a {@link CryptoKeyPair}
78-
* @param subtleCrypto a {@link SubtleCrypto} interface in case one is not available globally
77+
* @param keyPair a CryptoKeyPair
78+
* @param subtleCrypto - a SubtleCrypto interface in case one is not available globally
7979
* @returns an {@link ECDSAKeyIdentity}
8080
*/
8181
public static async fromKeyPair(
@@ -108,7 +108,7 @@ export class ECDSAKeyIdentity extends SignIdentity {
108108

109109
/**
110110
* Return the internally-used key pair.
111-
* @returns a {@link CryptoKeyPair}
111+
* @returns a CryptoKeyPair
112112
*/
113113
public getKeyPair(): CryptoKeyPair {
114114
return this._keyPair;

0 commit comments

Comments
 (0)