Skip to content

Commit 80f0cee

Browse files
committed
Destructure window to retrieve global variables
1 parent 959d21b commit 80f0cee

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

.eslintrc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
"globals": {
3-
"alert": true,
4-
"history": true,
5-
"parent": true
6-
},
72
"root": true,
83
"extends": [
94
"plugin:@wordpress/eslint-plugin/recommended",

assets/src/admin/paired-browsing/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global ampSlug, ampPairedBrowsingQueryVar */
1+
const { ampSlug, ampPairedBrowsingQueryVar, alert, history } = window;
22

33
class PairedBrowsingApp {
44
/**

assets/src/admin/paired-browsing/client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { parent } = window;
2+
13
if ( parent.pairedBrowsingApp ) {
24
window.ampPairedBrowsingClient = true;
35
const app = parent.pairedBrowsingApp;

0 commit comments

Comments
 (0)