Skip to content

Commit 776d1c6

Browse files
committed
Lint fixes
1 parent 2e75000 commit 776d1c6

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

packages/react-devtools-extensions/src/injectGlobalHook.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ window.addEventListener('message', function(evt) {
3232
};
3333
chrome.runtime.sendMessage(lastDetectionResult);
3434

35-
// Inject the backend. This is done in the content script to avoid CSP
36-
// and Trusted Types violations, since content scripts can modify the DOM
37-
// and are not subject to the page's policies
35+
// Inject the backend. This is done in the content script to avoid CSP
36+
// and Trusted Types violations, since content scripts can modify the DOM
37+
// and are not subject to the page's policies.
3838
} else if (evt.data.source === 'react-devtools-inject-backend') {
3939
// the prototype stuff is in case document.createElement has been modified
40-
var script = document.constructor.prototype.createElement.call(document, 'script');
40+
const script = document.constructor.prototype.createElement.call(
41+
document,
42+
'script',
43+
);
4144
script.src = chrome.runtime.getURL('build/backend.js');
42-
script.charset = "utf-8";
45+
script.charset = 'utf-8';
4346
document.documentElement.appendChild(script);
4447
script.parentNode.removeChild(script);
4548
}

packages/react-devtools-extensions/src/main.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {createElement} from 'react';
44
import {unstable_createRoot as createRoot, flushSync} from 'react-dom';
55
import Bridge from 'react-devtools-shared/src/bridge';
66
import Store from 'react-devtools-shared/src/devtools/store';
7-
import inject from './inject';
87
import {
98
createViewElementSource,
109
getBrowserName,
@@ -136,12 +135,12 @@ function createPanelIfReactLoaded() {
136135
// Initialize the backend only once the Store has been initialized.
137136
// Otherwise the Store may miss important initial tree op codes.
138137
chrome.devtools.inspectedWindow.eval(
139-
`window.postMessage({ source: 'react-devtools-inject-backend' });`,
140-
function(response, error) {
141-
if (error) {
142-
console.log(error);
138+
`window.postMessage({ source: 'react-devtools-inject-backend' });`,
139+
function(response, evalError) {
140+
if (evalError) {
141+
console.log(evalError);
143142
}
144-
}
143+
},
145144
);
146145

147146
const viewElementSourceFunction = createViewElementSource(

0 commit comments

Comments
 (0)