diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-14 22:26:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-15 03:26:29 +0000 |
commit | 6bf7b0055765c4f2011c9614753d6714dc09be65 (patch) | |
tree | 0e782ae66556eaa61a34d9f32d77c831b2443ce5 /test/document-util.test.js | |
parent | 7a4096240ce4faf70a785d047945388baa0daab3 (diff) |
Eslint rule updates (#673)
* Install unicorn
* Add rules
* Fix issues
* Install sonarjs
* Set up rules
* Fix issues
* Install eslint-plugin-import and fix import extensions
* Simplify permitted error names
Diffstat (limited to 'test/document-util.test.js')
-rw-r--r-- | test/document-util.test.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/document-util.test.js b/test/document-util.test.js index 18a5d42c..c2b2edca 100644 --- a/test/document-util.test.js +++ b/test/document-util.test.js @@ -159,12 +159,13 @@ describe('Document utility tests', () => { expect(!!imposter).toStrictEqual(!!hasImposter); const range = document.createRange(); - range.setStart(/** @type {Node} */ (imposter ? imposter : startNode), startOffset); - range.setEnd(/** @type {Node} */ (imposter ? imposter : startNode), endOffset); + range.setStart(/** @type {Node} */ (imposter ?? startNode), startOffset); + range.setEnd(/** @type {Node} */ (imposter ?? startNode), endOffset); // Override getClientRects to return a rect guaranteed to contain (x, y) range.getClientRects = () => { /** @type {import('test/document-types').PseudoDOMRectList} */ + // eslint-disable-next-line sonarjs/prefer-immediate-return const domRectList = Object.assign( [new DOMRect(x - 1, y - 1, 2, 2)], { |