style: fix no-prototype-builtins violations

This commit is contained in:
Christopher Willis-Ford 2024-02-26 13:35:15 -08:00
parent 34aee46da4
commit 170256c20f
7 changed files with 11 additions and 11 deletions

View file

@ -28,7 +28,7 @@ const freshdeskLocale = locale => {
'zh-cn': 'zh-CN',
'zh-tw': 'zh-TW'
};
if (localeMap.hasOwnProperty(locale)) {
if (Object.prototype.hasOwnProperty.call(localeMap, locale)) {
return localeMap[locale];
}
// locale will either be supported by Freshdesk, or will default to English if not

View file

@ -50,7 +50,7 @@ class EmailStep extends React.Component {
}
// simple function to memoize remote requests for usernames
validateEmailRemotelyWithCache (email) {
if (this.emailRemoteCache.hasOwnProperty(email)) {
if (Object.prototype.hasOwnProperty.call(this.emailRemoteCache, email)) {
return Promise.resolve(this.emailRemoteCache[email]);
}
// email is not in our cache

View file

@ -12,9 +12,9 @@ const wwwLocaleToScratchWikiLocale = {
};
const getScratchWikiLink = locale => {
if (!wwwLocaleToScratchWikiLocale.hasOwnProperty(locale)) {
if (!Object.prototype.hasOwnProperty.call(wwwLocaleToScratchWikiLocale, locale)) {
locale = locale.split('-')[0];
if (!wwwLocaleToScratchWikiLocale.hasOwnProperty(locale)) {
if (!Object.prototype.hasOwnProperty.call(wwwLocaleToScratchWikiLocale, locale)) {
locale = 'en';
}
}

View file

@ -172,7 +172,7 @@ class AnnualReport extends React.Component {
// Find which section is currently visible based on our scroll position
for (const key in this.sectionRefs) {
if (!this.sectionRefs.hasOwnProperty(key)) continue;
if (!Object.prototype.hasOwnProperty.call(this.sectionRefs, key)) continue;
const currentRef = this.sectionRefs[key];
const {offsetBottom, offsetTop} = this.getDimensionsOfSection(currentRef);
if (currentScrollPosition > offsetTop && currentScrollPosition < offsetBottom) {

View file

@ -192,7 +192,7 @@ class AnnualReport extends React.Component {
// Find which section is currently visible based on our scroll position
for (const key in this.sectionRefs) {
if (!this.sectionRefs.hasOwnProperty(key)) continue;
if (!Object.prototype.hasOwnProperty.call(this.sectionRefs, key)) continue;
const currentRef = this.sectionRefs[key];
const {offsetBottom, offsetTop} = this.getDimensionsOfSection(currentRef);
if (currentScrollPosition > offsetTop && currentScrollPosition < offsetBottom) {

View file

@ -219,7 +219,7 @@ class AnnualReport extends React.Component {
// Find which section is currently visible based on our scroll position
for (const key in this.sectionRefs) {
if (!this.sectionRefs.hasOwnProperty(key)) continue;
if (!Object.prototype.hasOwnProperty.call(this.sectionRefs, key)) continue;
const currentRef = this.sectionRefs[key];
const {offsetBottom, offsetTop} = this.getDimensionsOfSection(currentRef);
if (currentScrollPosition > offsetTop && currentScrollPosition < offsetBottom) {

View file

@ -247,10 +247,10 @@ class Preview extends React.Component {
};
const creatingProject = projectId === null || typeof projectId === 'undefined';
const queryParams = {};
if (params.hasOwnProperty('originalId')) queryParams.original_id = params.originalId;
if (params.hasOwnProperty('isCopy')) queryParams.is_copy = params.isCopy;
if (params.hasOwnProperty('isRemix')) queryParams.is_remix = params.isRemix;
if (params.hasOwnProperty('title')) queryParams.title = params.title;
if (Object.prototype.hasOwnProperty.call(params, 'originalId')) queryParams.original_id = params.originalId;
if (Object.prototype.hasOwnProperty.call(params, 'isCopy')) queryParams.is_copy = params.isCopy;
if (Object.prototype.hasOwnProperty.call(params, 'isRemix')) queryParams.is_remix = params.isRemix;
if (Object.prototype.hasOwnProperty.call(params, 'title')) queryParams.title = params.title;
let qs = queryString.stringify(queryParams);
if (qs) qs = `?${qs}`;
if (creatingProject) {