Skip to content

Commit 5310e20

Browse files
committed
style: lint
1 parent 9069853 commit 5310e20

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

docs/assets/theme/theme.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Theme {
99
var theme = localStorage.getItem( STORAGE_KEY );
1010

1111
if ( !theme || !THEMES.has( theme ) ) {
12-
theme = window.matchMedia && window.matchMedia( "(prefers-color-scheme: dark)" ).matches
12+
theme = globalThis.matchMedia && globalThis.matchMedia( "(prefers-color-scheme: dark)" ).matches
1313
? "dark"
1414
: "light";
1515
}
@@ -22,11 +22,11 @@ class Theme {
2222
// set gotoTop click handler
2323
document.querySelectorAll( `a[href="#gotoTop"]` ).forEach( el => ( el.onclick = this.#gotoTop.bind( this ) ) );
2424

25-
window.$docsify.plugins ||= [];
26-
window.$docsify.plugins.push( this.#docsifyHook.bind( this ) );
25+
globalThis.$docsify.plugins ||= [];
26+
globalThis.$docsify.plugins.push( this.#docsifyHook.bind( this ) );
2727

2828
// listen for system dark mode change
29-
window.matchMedia( "(prefers-color-scheme: dark)" ).addEventListener( "change", e => {
29+
globalThis.matchMedia( "(prefers-color-scheme: dark)" ).addEventListener( "change", e => {
3030
this.#setTheme( e.matches
3131
? "dark"
3232
: "light" );
@@ -35,7 +35,7 @@ class Theme {
3535

3636
// private
3737
#gotoTop ( e ) {
38-
const oldUrl = window.location.href,
38+
const oldUrl = globalThis.location.href,
3939
newUrl = oldUrl.replace( /\?.*/, "" );
4040

4141
if ( oldUrl !== newUrl ) history.pushState( {}, null, newUrl );
@@ -100,7 +100,7 @@ class Theme {
100100
}
101101

102102
#linkifyTypes ( markdown ) {
103-
const types = window.$docsify.types;
103+
const types = globalThis.$docsify.types;
104104

105105
if ( !types ) return markdown;
106106

@@ -143,7 +143,7 @@ class Theme {
143143
}
144144

145145
#styleTypes () {
146-
const types = window.$docsify.types;
146+
const types = globalThis.$docsify.types;
147147

148148
if ( !types ) return;
149149

resources/eslint/unicorn.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ const CONFIG = [
5050
"unicorn/prefer-code-point": "error",
5151
"unicorn/prefer-date-now": "error",
5252
"unicorn/prefer-dom-node-append": "error",
53-
54-
// "unicorn/prefer-global-this": "error",
53+
"unicorn/prefer-global-this": "error",
5554
"unicorn/prefer-dom-node-remove": "error",
5655
"unicorn/prefer-import-meta-properties": "error",
5756
"unicorn/prefer-modern-dom-apis": "error",

0 commit comments

Comments
 (0)