mirror of
https://github.com/cheeriojs/cheerio.git
synced 2026-02-25 23:25:17 +00:00
refactor: Remove unused eslint disable directives
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user