refactor: Remove unused eslint disable directives

This commit is contained in:
Felix
2024-08-06 16:01:49 +01:00
parent 599967f376
commit 5f9b028979
4 changed files with 7 additions and 8 deletions

View File

@@ -69,7 +69,8 @@
"types": "./dist/commonjs/utils.d.ts",
"default": "./dist/commonjs/utils.js"
}
}
},
"./package.json": "./package.json"
},
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
@@ -85,7 +86,7 @@
"format:prettier": "npm run format:prettier:raw -- --write",
"format:prettier:raw": "prettier \"**/*.{{m,c,}{j,t}s{x,},md{x,},json,y{a,}ml}\" --ignore-path .gitignore",
"lint": "npm run lint:es && npm run lint:prettier",
"lint:es": "eslint --ignore-path .gitignore .",
"lint:es": "eslint --report-unused-disable-directives --ignore-path .gitignore .",
"lint:prettier": "npm run format:prettier:raw -- --check",
"prepare": "husky install",
"prepublishOnly": "npm run build",
@@ -162,7 +163,8 @@
"exports": {
".": "./src/index.ts",
"./slim": "./src/slim.ts",
"./utils": "./src/utils.ts"
"./utils": "./src/utils.ts",
"./package.json": "./package.json"
},
"exclude": [
"**/*.spec.ts",

View File

@@ -430,10 +430,9 @@ export function prop<T extends AnyNode>(
case 'src': {
const prop = el.attribs?.[name];
/* eslint-disable n/no-unsupported-features/node-builtins */
if (
typeof URL !== 'undefined' &&
((name === 'href' && (el.tagName === 'a' || el.name === 'link')) ||
((name === 'href' && (el.tagName === 'a' || el.tagName === 'link')) ||
(name === 'src' &&
(el.tagName === 'img' ||
el.tagName === 'iframe' ||
@@ -445,7 +444,6 @@ export function prop<T extends AnyNode>(
) {
return new URL(prop, this.options.baseURI).href;
}
/* eslint-enable n/no-unsupported-features/node-builtins */
return prop;
}

View File

@@ -25,7 +25,6 @@ describe('.load', () => {
it('(buffer) : should accept a buffer', () => {
const html = '<html><head></head><body>foo</body></html>';
// eslint-disable-next-line n/no-unsupported-features/node-builtins
const $html = load(Buffer.from(html));
expect($html.html()).toBe(html);
});

View File

@@ -39,7 +39,7 @@ export interface CheerioOptions
xmlMode?: boolean;
/** The base URI for the document. Used to resolve the `href` and `src` props. */
baseURI?: string | URL; // eslint-disable-line n/no-unsupported-features/node-builtins
baseURI?: string | URL;
/**
* Is the document in quirks mode?