From d452be2b59ccdcc4ad356bfd2851fd9cd2cf2eca Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 20 Aug 2024 18:13:38 +0700 Subject: [PATCH] Fix CI Fixes #10 --- .github/workflows/main.yml | 8 +++++--- index.js | 4 ++-- package.json | 6 ++++-- readme.md | 4 ++-- test.js | 6 +++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b8aa86..c0c488e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,14 @@ jobs: fail-fast: false matrix: node-version: + - 22 + - 20 + - 18 - 16 - 14 - - 12 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/index.js b/index.js index c256609..2cea66f 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ const domLoaded = new Promise(resolve => { }, { capture: true, once: true, - passive: true + passive: true, }); } }); @@ -17,5 +17,5 @@ const domLoaded = new Promise(resolve => { export default domLoaded; Object.defineProperty(domLoaded, 'hasLoaded', { - get: () => hasLoaded() + get: () => hasLoaded(), }); diff --git a/package.json b/package.json index 065b554..c0d2010 100644 --- a/package.json +++ b/package.json @@ -12,12 +12,14 @@ }, "type": "module", "exports": "./index.js", + "types": "./index.d.ts", + "sideEffects": false, "engines": { "node": ">=12" }, "scripts": { "// TODO: Enable when JSOM support ESM - test": "xo && ava && tsd", - "test": "xo && tsd" + "test": "xo" }, "files": [ "index.js", @@ -38,7 +40,7 @@ "ava": "^3.15.0", "jsdom": "^16.5.3", "tsd": "^0.14.0", - "xo": "^0.39.1" + "xo": "^0.54.0" }, "xo": { "envs": [ diff --git a/readme.md b/readme.md index 3f7039c..625e2ab 100644 --- a/readme.md +++ b/readme.md @@ -6,8 +6,8 @@ Unlike `DOMContentLoaded`, this also works when included after the DOM was loade ## Install -``` -$ npm install dom-loaded +```sh +npm install dom-loaded ``` ## Usage diff --git a/test.js b/test.js index baf50eb..a730b77 100644 --- a/test.js +++ b/test.js @@ -13,7 +13,7 @@ const umdWrappedDomLoaded = ` test('works when included before `DOMContentLoaded` fired', async t => { const {window} = new JSDOM('', { - runScripts: 'outside-only' + runScripts: 'outside-only', }); window.eval(umdWrappedDomLoaded); @@ -33,7 +33,7 @@ test('works when included before `DOMContentLoaded` fired', async t => { test('works when included after `DOMContentLoaded` fired', async t => { const {window} = new JSDOM('', { - runScripts: 'outside-only' + runScripts: 'outside-only', }); const loadedPromise = new Promise(resolve => { @@ -51,7 +51,7 @@ test('works when included after `DOMContentLoaded` fired', async t => { test('domLoaded.hasLoaded', async t => { const {window} = new JSDOM('', { - runScripts: 'outside-only' + runScripts: 'outside-only', }); const loadedPromise = new Promise(resolve => {