Skip to content

Commit 4f81079

Browse files
committed
Declare DOMParser as a global to avoid disabling eslint on specific lines
1 parent 2cf2f00 commit 4f81079

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*global DOMParser*/
12
var matchesSelector = require('./matchesSelector');
23

34
function parseHtml(str, isFragment, assertionNameForErrorMessage) {
@@ -6,7 +7,6 @@ function parseHtml(str, isFragment, assertionNameForErrorMessage) {
67
}
78
var htmlDocument;
89
if (typeof DOMParser !== 'undefined') {
9-
// eslint-disable-next-line no-undef
1010
htmlDocument = new DOMParser().parseFromString(str, 'text/html');
1111
} else if (
1212
typeof document !== 'undefined' &&
@@ -52,7 +52,6 @@ function parseHtml(str, isFragment, assertionNameForErrorMessage) {
5252

5353
function parseXml(str, assertionNameForErrorMessage) {
5454
if (typeof DOMParser !== 'undefined') {
55-
// eslint-disable-next-line no-undef
5655
return new DOMParser().parseFromString(str, 'text/xml');
5756
} else {
5857
var jsdom;

0 commit comments

Comments
 (0)