diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index cddff0b..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - browser: true - }, - extends: [ - 'digitalbazaar', - 'digitalbazaar/jsdoc', - 'digitalbazaar/module' - ], - ignorePatterns: ['dist/'] -}; diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4d7e05b..1db0508 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,19 +2,18 @@ name: Main CI on: [push] +permissions: {} + jobs: lint: runs-on: ubuntu-latest timeout-minutes: 10 - strategy: - matrix: - node-version: [20.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + - uses: actions/checkout@v6 + - name: Use Node.js 22.x + uses: actions/setup-node@v6 with: - node-version: ${{ matrix.node-version }} + node-version: 22.x - name: Install run: npm install - name: Lint diff --git a/.gitignore b/.gitignore index 9a4fe4d..010f201 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ coverage dist node_modules npm-debug.log +package-lock.json reports diff --git a/CHANGELOG.md b/CHANGELOG.md index 0057ecb..4809342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # credential-handler-polyfill ChangeLog +## 4.0.3 - 2026-06-dd + +### Changed +- Update dev dependencies: + - Use `@digitalbazaar/eslint-config@8` with eslint 9 flat config, + replacing `eslint-config-digitalbazaar`. + - Use `webpack-cli@7`. +- Update GitHub Actions to use Node.js 22.x and current action versions. + ## 4.0.2 - 2026-06-12 ### Fixed diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..e99859f --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,17 @@ +/*! + * Copyright (c) 2026 Digital Bazaar, Inc. + */ +import config from '@digitalbazaar/eslint-config/browser-recommended'; +import globals from 'globals'; + +export default [ + ...config, + { + files: ['webpack.config.js'], + languageOptions: { + globals: { + ...globals.node + } + } + } +]; diff --git a/lib/CredentialHandler.js b/lib/CredentialHandler.js index 39378d0..751712f 100644 --- a/lib/CredentialHandler.js +++ b/lib/CredentialHandler.js @@ -1,9 +1,8 @@ /*! * The core CredentialHandler class. * - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ -/* global DOMException */ import {EventEmitter, WebApp} from 'web-request-rpc'; import {CredentialHandlerService} from './CredentialHandlerService.js'; diff --git a/lib/CredentialHints.js b/lib/CredentialHints.js index c9c3613..7f329a6 100644 --- a/lib/CredentialHints.js +++ b/lib/CredentialHints.js @@ -1,7 +1,6 @@ /*! - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ -/* global Image */ export class CredentialHints { constructor(url, injector) { const remote = injector.get('credentialHints', { diff --git a/lib/CredentialManager.js b/lib/CredentialManager.js index 376c935..e69b7c6 100644 --- a/lib/CredentialManager.js +++ b/lib/CredentialManager.js @@ -1,7 +1,6 @@ /*! - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ -/* global navigator */ import {CredentialHints} from './CredentialHints.js'; /* A CredentialManager for a Web Credential Mediator. */ diff --git a/lib/CredentialsContainer.js b/lib/CredentialsContainer.js index 47d226e..7222a14 100644 --- a/lib/CredentialsContainer.js +++ b/lib/CredentialsContainer.js @@ -2,9 +2,8 @@ * Wrapper for native CredentialsContainer that uses remote Credential Mediator * for WebCredential-related operations. * - * Copyright (c) 2017-2024 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ -/* global navigator, DOMException */ import {WebCredential} from './WebCredential.js'; // RPC timeouts, 0 = indefinite @@ -17,7 +16,7 @@ export class CredentialsContainer { get: navigator.credentials && navigator.credentials.get && navigator.credentials.get.bind(navigator.credentials), store: navigator.credentials && navigator.credentials.store && - navigator.credentials.store.bind(navigator.credentials), + navigator.credentials.store.bind(navigator.credentials) }; this._init = (async () => { diff --git a/lib/index.js b/lib/index.js index 62be7eb..eb0662d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,6 @@ /*! * Copyright (c) 2017-2026 Digital Bazaar, Inc. */ -/* global navigator, window */ import {WebAppContext} from 'web-request-rpc'; import {CredentialHandler} from './CredentialHandler.js'; @@ -109,7 +108,7 @@ export async function load(options = { value: navCredentialsProxy, writable: true }); - } catch(e) { + } catch { // on WebKit, `navigator.credentials` is a non-configurable property // that cannot be redefined as a data property; fall back to plain // assignment and, if that also fails, continue without the proxy -- @@ -118,7 +117,9 @@ export async function load(options = { // subsequent overwrites of `navigator.credentials` itself is lost try { navigator.credentials = navCredentialsProxy; - } catch(e2) {} + } catch { + // ignore; continue without overwrite protection + } } window.CredentialManager = CredentialManager; diff --git a/package.json b/package.json index 1b14cb3..9d88118 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "prepublish": "npm run build", "build": "webpack", - "lint": "eslint --ext .cjs,.js ." + "lint": "eslint --no-warn-ignored ." }, "repository": { "type": "git", @@ -33,12 +33,10 @@ "web-request-rpc": "^3.0.1" }, "devDependencies": { - "eslint": "^8.57.0", - "eslint-config-digitalbazaar": "^5.2.0", - "eslint-plugin-jsdoc": "^48.4.0", - "eslint-plugin-unicorn": "^54.0.0", - "webpack": "^5.92.1", - "webpack-cli": "^5.1.4" + "@digitalbazaar/eslint-config": "^8.0.1", + "eslint": "^9.39.4", + "webpack": "^5.107.2", + "webpack-cli": "^7.0.3" }, "bedrock": { "browserDependencies": [