Skip to content

Commit 866e594

Browse files
authored
ref: Stop disabling no-prototype-builtins rule (#4121)
Updates browser, serverless and utils packages to no longer disable the `no-prototype-builtins` eslint rule.
1 parent dcd549b commit 866e594

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

packages/browser/src/transports/xhr.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export class XHRTransport extends BaseTransport {
5656

5757
request.open('POST', sentryRequest.url);
5858
for (const header in this.options.headers) {
59-
// eslint-disable-next-line no-prototype-builtins
60-
if (this.options.headers.hasOwnProperty(header)) {
59+
if (Object.prototype.hasOwnProperty.call(this.options.headers, header)) {
6160
request.setRequestHeader(header, this.options.headers[header]);
6261
}
6362
}

packages/serverless/src/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ export function proxyFunction<A extends any[], R, F extends (...args: A) => R>(
6060

6161
if (overrides) {
6262
handler.get = (target, prop) => {
63-
// eslint-disable-next-line no-prototype-builtins
64-
if (overrides.hasOwnProperty(prop)) {
63+
if (Object.prototype.hasOwnProperty.call(overrides, prop)) {
6564
return overrides[prop as string];
6665
}
6766
return (target as Record<PropertyKey, unknown>)[prop as string];

packages/utils/src/polyfill.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ function setProtoOf<TTarget extends object, TProto>(obj: TTarget, proto: TProto)
1717
// eslint-disable-next-line @typescript-eslint/ban-types
1818
function mixinProperties<TTarget extends object, TProto>(obj: TTarget, proto: TProto): TTarget & TProto {
1919
for (const prop in proto) {
20-
// eslint-disable-next-line no-prototype-builtins
21-
if (!obj.hasOwnProperty(prop)) {
20+
if (!Object.prototype.hasOwnProperty.call(obj, prop)) {
2221
// @ts-ignore typescript complains about indexing so we remove
2322
obj[prop] = proto[prop];
2423
}

0 commit comments

Comments
 (0)