Skip to content

Commit cef03c8

Browse files
committed
Fix shadowed variables
1 parent e7b52ec commit cef03c8

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export default[
8989
"no-nested-ternary": "off",
9090
"no-param-reassign": "off",
9191
"no-plusplus": "off",
92-
"no-shadow": "off",
9392
"no-tabs": "off",
9493
"no-ternary": "off",
9594
"no-trailing-spaces": [ "error" ],

options/options.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@
141141

142142
try
143143
{
144-
ExtensionApi.permissions.request( permissions ).catch( e =>
144+
ExtensionApi.permissions.request( permissions ).catch( ex =>
145145
{
146-
alert( `Failed to request permissions: ${e.message}` );
146+
alert( `Failed to request permissions: ${ex.message}` );
147147
} );
148148
}
149-
catch( e )
149+
catch( ex )
150150
{
151-
alert( `Failed to request permissions: ${e}` );
151+
alert( `Failed to request permissions: ${ex}` );
152152
}
153153
} );
154154

scripts/community/achievements.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,10 @@ function InitAchievements( items, isPersonal )
785785

786786
if( isCompareView )
787787
{
788-
const image = document.createElement( 'img' );
789-
image.src = `${applicationConfig.MEDIA_CDN_COMMUNITY_URL}images/apps/${appid}/${player.unlockCompare && achievement.icon_gray ? achievement.icon : achievement.icon_gray}`;
790-
image.className = 'steamdb_achievement_image steamdb_achievement_image_compare';
791-
element.append( image );
788+
const imageCompare = document.createElement( 'img' );
789+
imageCompare.src = `${applicationConfig.MEDIA_CDN_COMMUNITY_URL}images/apps/${appid}/${player.unlockCompare && achievement.icon_gray ? achievement.icon : achievement.icon_gray}`;
790+
imageCompare.className = 'steamdb_achievement_image steamdb_achievement_image_compare';
791+
element.append( imageCompare );
792792
}
793793

794794
return element;
@@ -1180,10 +1180,10 @@ function InitAchievements( items, isPersonal )
11801180
{
11811181
dlcCapsulesPromise.then( ( images ) =>
11821182
{
1183-
for( const [ appid, url ] of images )
1183+
for( const [ dlcAppId, url ] of images )
11841184
{
11851185
/** @type {NodeListOf<HTMLImageElement>} */
1186-
const imageTags = document.querySelectorAll( `.steamdb_achievements_game_logo[data-appid="${appid}"]` );
1186+
const imageTags = document.querySelectorAll( `.steamdb_achievements_game_logo[data-appid="${dlcAppId}"]` );
11871187

11881188
for( const image of imageTags )
11891189
{
@@ -1590,10 +1590,10 @@ function HookSortButton( sortButton, achievementUpdates, oldAchievementRows, Cre
15901590

15911591
StartViewTransition( RedrawSortedAchievements );
15921592
} )
1593-
.catch( e =>
1593+
.catch( ex =>
15941594
{
1595-
WriteLog( e );
1596-
alert( `Failed to sort achievements: ${e.message}` );
1595+
WriteLog( ex );
1596+
alert( `Failed to sort achievements: ${ex.message}` );
15971597
} );
15981598
}, { once: true } );
15991599
}

scripts/store/app.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
'use strict';
44

5-
const container = document.getElementById( 'error_box' );
65
const language = GetLanguage();
76
const numberFormatter = new Intl.NumberFormat( language );
87

9-
if( container )
8+
if( document.getElementById( 'error_box' ) )
109
{
11-
AddLinksInErrorBox( container );
10+
AddLinksInErrorBox( document.getElementById( 'error_box' ) );
1211
}
1312
else
1413
{
@@ -280,9 +279,9 @@ else
280279
// Bundles
281280
container = document.querySelectorAll( 'input[name="bundleid"]' );
282281

283-
for( const element of container )
282+
for( const bundleElement of container )
284283
{
285-
InsertPurchaseBlockId( element.closest( '.game_area_purchase_game' ).querySelector( '.game_purchase_action' ), 'bundle', Number.parseInt( element.value, 10 ) );
284+
InsertPurchaseBlockId( bundleElement.closest( '.game_area_purchase_game' ).querySelector( '.game_purchase_action' ), 'bundle', Number.parseInt( bundleElement.value, 10 ) );
286285
}
287286

288287
// We have to inject our JS directly into the page to hook Steam's functionatily
@@ -1174,9 +1173,9 @@ function AddLinksToDevelopers()
11741173
rows.push( row );
11751174
}
11761175

1177-
for( const row of rows )
1176+
for( const innerRow of rows )
11781177
{
1179-
const container = row.querySelector( '.summary.column' );
1178+
const container = innerRow.querySelector( '.summary.column' );
11801179

11811180
if( !container )
11821181
{

0 commit comments

Comments
 (0)