File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const { getBaseConfig } = require('@openedx/frontend-build');
3
3
4
4
const config = getBaseConfig ( 'eslint' ) ;
5
5
6
+ config . globals = { globalThis : 'readonly' } ;
6
7
config . rules = {
7
8
'import/no-extraneous-dependencies' : [ 'error' , {
8
9
devDependencies : [
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ export function getLocale(locale) {
167
167
// Note that some browers prefer upper case for the region part of the locale, while others don't.
168
168
// Thus the toLowerCase, for consistency.
169
169
// https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language
170
- return findSupportedLocale ( global . navigator . language . toLowerCase ( ) ) ;
170
+ return findSupportedLocale ( globalThis . navigator . language . toLowerCase ( ) ) ;
171
171
}
172
172
173
173
/**
@@ -199,9 +199,9 @@ export function isRtl(locale) {
199
199
*/
200
200
export function handleRtl ( ) {
201
201
if ( isRtl ( getLocale ( ) ) ) {
202
- global . document . getElementsByTagName ( 'html' ) [ 0 ] . setAttribute ( 'dir' , 'rtl' ) ;
202
+ globalThis . document . getElementsByTagName ( 'html' ) [ 0 ] . setAttribute ( 'dir' , 'rtl' ) ;
203
203
} else {
204
- global . document . getElementsByTagName ( 'html' ) [ 0 ] . setAttribute ( 'dir' , 'ltr' ) ;
204
+ globalThis . document . getElementsByTagName ( 'html' ) [ 0 ] . setAttribute ( 'dir' , 'ltr' ) ;
205
205
}
206
206
}
207
207
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ export async function initError(error) {
140
140
*/
141
141
export async function auth ( requireUser , hydrateUser ) {
142
142
if ( requireUser ) {
143
- await ensureAuthenticatedUser ( global . location . href ) ;
143
+ await ensureAuthenticatedUser ( globalThis . location . href ) ;
144
144
} else {
145
145
await fetchAuthenticatedUser ( ) ;
146
146
}
You can’t perform that action at this time.
0 commit comments