Skip to content

Commit

Permalink
refactor: Remove unused eslint disable directives
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 committed Aug 6, 2024
1 parent 599967f commit 5f9b028
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions src/api/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' ||
Expand All @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion src/load.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 5f9b028

Please sign in to comment.