Skip to content

ref: Stop disabling no-prototype-builtins rule #4121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/browser/src/transports/xhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ export class XHRTransport extends BaseTransport {

request.open('POST', sentryRequest.url);
for (const header in this.options.headers) {
// eslint-disable-next-line no-prototype-builtins
if (this.options.headers.hasOwnProperty(header)) {
if (Object.prototype.hasOwnProperty.call(this.options.headers, header)) {
request.setRequestHeader(header, this.options.headers[header]);
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/serverless/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export function proxyFunction<A extends any[], R, F extends (...args: A) => R>(

if (overrides) {
handler.get = (target, prop) => {
// eslint-disable-next-line no-prototype-builtins
if (overrides.hasOwnProperty(prop)) {
if (Object.prototype.hasOwnProperty.call(overrides, prop)) {
return overrides[prop as string];
}
return (target as Record<PropertyKey, unknown>)[prop as string];
Expand Down
3 changes: 1 addition & 2 deletions packages/utils/src/polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ function setProtoOf<TTarget extends object, TProto>(obj: TTarget, proto: TProto)
// eslint-disable-next-line @typescript-eslint/ban-types
function mixinProperties<TTarget extends object, TProto>(obj: TTarget, proto: TProto): TTarget & TProto {
for (const prop in proto) {
// eslint-disable-next-line no-prototype-builtins
if (!obj.hasOwnProperty(prop)) {
if (!Object.prototype.hasOwnProperty.call(obj, prop)) {
// @ts-ignore typescript complains about indexing so we remove
obj[prop] = proto[prop];
}
Expand Down