Skip to content

Commit ac2e861

Browse files
author
Brian Vaughn
committed
Fixed a bunch of Lint issues
1 parent 51626ae commit ac2e861

File tree

140 files changed

+253
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+253
-305
lines changed

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ scripts/bench/benchmarks/**/*.js
1212

1313
# React repository clone
1414
scripts/bench/remote-repo/
15+
16+
packages/react-devtools-core/dist
17+
packages/react-devtools-extensions/chrome/build
18+
packages/react-devtools-extensions/firefox/build
19+
packages/react-devtools-extensions/shared/build
20+
packages/react-devtools-inline/dist
21+
packages/react-devtools-shell/dist

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,14 @@ chrome-user-data
2222
.vscode
2323
*.swp
2424
*.swo
25+
26+
packages/react-devtools-core/dist
27+
packages/react-devtools-extensions/chrome/build
28+
packages/react-devtools-extensions/chrome/*.crx
29+
packages/react-devtools-extensions/chrome/*.pem
30+
packages/react-devtools-extensions/firefox/build
31+
packages/react-devtools-extensions/firefox/*.xpi
32+
packages/react-devtools-extensions/firefox/*.pem
33+
packages/react-devtools-extensions/shared/build
34+
packages/react-devtools-inline/dist
35+
packages/react-devtools-shell/dist

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
packages/react-devtools-core/dist
2+
packages/react-devtools-extensions/chrome/build
3+
packages/react-devtools-extensions/firefox/build
4+
packages/react-devtools-extensions/shared/build
5+
packages/react-devtools-inline/dist
6+
packages/react-devtools-shell/dist

packages/react-devtools-core/src/backend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
253253
}
254254
} catch (e) {
255255
console.error(
256-
'[React DevTools] Failed to parse JSON: ' + String(event.data),
256+
'[React DevTools] Failed to parse JSON: ' + (event.data: any),
257257
);
258258
return;
259259
}

packages/react-devtools-extensions/.eslintignore

-13
This file was deleted.

packages/react-devtools-extensions/.eslintrc

-19
This file was deleted.

packages/react-devtools-extensions/.flowconfig

-35
This file was deleted.

packages/react-devtools-extensions/.gitignore

-21
This file was deleted.

packages/react-devtools-extensions/.prettierignore

-9
This file was deleted.

packages/react-devtools-extensions/.prettierrc

-4
This file was deleted.

packages/react-devtools-extensions/shared/build.js packages/react-devtools-extensions/build.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
const archiver = require('archiver');
46
const {execSync} = require('child_process');
57
const {readFileSync, writeFileSync, createWriteStream} = require('fs');
@@ -28,23 +30,23 @@ const build = async (tempPath, manifestPath) => {
2830
'..',
2931
'node_modules',
3032
'.bin',
31-
'webpack'
33+
'webpack',
3234
);
3335
execSync(
3436
`${webpackPath} --config webpack.config.js --output-path ${binPath}`,
3537
{
3638
cwd: __dirname,
3739
env: process.env,
3840
stdio: 'inherit',
39-
}
41+
},
4042
);
4143
execSync(
4244
`${webpackPath} --config webpack.backend.js --output-path ${binPath}`,
4345
{
4446
cwd: __dirname,
4547
env: process.env,
4648
stdio: 'inherit',
47-
}
49+
},
4850
);
4951

5052
// Make temp dir
@@ -56,7 +58,7 @@ const build = async (tempPath, manifestPath) => {
5658
await copy(binPath, join(zipPath, 'build'));
5759
await copy(manifestPath, copiedManifestPath);
5860
await Promise.all(
59-
STATIC_FILES.map(file => copy(join(__dirname, file), join(zipPath, file)))
61+
STATIC_FILES.map(file => copy(join(__dirname, file), join(zipPath, file))),
6062
);
6163

6264
const commit = getGitCommit();

packages/react-devtools-extensions/chrome/build.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
const chalk = require('chalk');
46
const {execSync} = require('child_process');
57
const {existsSync} = require('fs');

packages/react-devtools-extensions/chrome/deploy.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
const deploy = require('../shared/deploy');
46

57
const main = async () => await deploy('chrome');

packages/react-devtools-extensions/chrome/test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env node
22

3-
const chromeLaunch = require('chrome-launch'); // eslint-disable-line import/no-extraneous-dependencies
3+
'use strict';
4+
5+
const chromeLaunch = require('chrome-launch');
46
const {resolve} = require('path');
57

68
const EXTENSION_PATH = resolve('shells/browser/chrome/build/unpacked');

packages/react-devtools-extensions/shared/deploy.js packages/react-devtools-extensions/deploy.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
const {exec, execSync} = require('child_process');
46
const {readFileSync, writeFileSync} = require('fs');
57
const {join} = require('path');

packages/react-devtools-extensions/firefox/build.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
const chalk = require('chalk');
46
const build = require('../shared/build');
57

packages/react-devtools-extensions/firefox/deploy.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
const deploy = require('../shared/deploy');
46

57
const main = async () => await deploy('firefox');

packages/react-devtools-extensions/firefox/test.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
const {exec} = require('child-process-promise');
46
const {Finder} = require('firefox-profile');
57
const {resolve} = require('path');

packages/react-devtools-extensions/flow-typed/chrome.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// @flow
22

3+
'use strict';
4+
35
declare var chrome: {
46
devtools: {
57
network: {

packages/react-devtools-extensions/flow-typed/jest.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
24
(...args: TArguments): TReturn,
35
/**

packages/react-devtools-extensions/flow-typed/npm/react-test-renderer_v16.x.x.js

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// Type definitions for react-test-renderer 16.x.x
55
// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer
66

7+
'use strict';
8+
79
type ReactComponentInstance = React$Component<any>;
810

911
type ReactTestRendererJSON = {

packages/react-devtools-extensions/flow.js

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ declare module 'node-events' {
1818
}
1919

2020
declare var __DEV__: boolean;
21-
declare var __TEST__: boolean;
2221

2322
declare var jasmine: {|
2423
getEnv: () => {|

packages/react-devtools-extensions/shared/popups/shared.js packages/react-devtools-extensions/popups/shared.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* globals chrome */
22

3+
'use strict';
4+
35
document.addEventListener('DOMContentLoaded', function() {
46
// Make links work
57
const links = document.getElementsByTagName('a');

packages/react-devtools-extensions/shared/src/backend.js packages/react-devtools-extensions/src/backend.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/** @flow */
66

7+
'use strict';
8+
79
function welcome(event) {
810
if (
911
event.source !== window ||
@@ -51,7 +53,7 @@ function setup(hook) {
5153
payload: {event, payload},
5254
},
5355
'*',
54-
transferable
56+
transferable,
5557
);
5658
},
5759
});
@@ -66,12 +68,12 @@ function setup(hook) {
6668
initBackend(hook, agent, window);
6769

6870
// Setup React Native style editor if a renderer like react-native-web has injected it.
69-
if (!!hook.resolveRNStyle) {
71+
if (hook.resolveRNStyle) {
7072
setupNativeStyleEditor(
7173
bridge,
7274
agent,
7375
hook.resolveRNStyle,
74-
hook.nativeStyleEditorValidAttributes
76+
hook.nativeStyleEditorValidAttributes,
7577
);
7678
}
7779
}

packages/react-devtools-extensions/shared/src/background.js packages/react-devtools-extensions/src/background.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* global chrome */
22

3+
'use strict';
4+
35
const ports = {};
46

57
const IS_FIREFOX = navigator.userAgent.indexOf('Firefox') >= 0;
@@ -37,7 +39,7 @@ function installContentScript(tabId: number) {
3739
chrome.tabs.executeScript(
3840
tabId,
3941
{file: '/build/contentScript.js'},
40-
function() {}
42+
function() {},
4143
);
4244
}
4345

packages/react-devtools-extensions/shared/src/contentScript.js packages/react-devtools-extensions/src/contentScript.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* global chrome */
22

3+
'use strict';
4+
35
let backendDisconnected: boolean = false;
46
let backendInitialized: boolean = false;
57

@@ -9,7 +11,7 @@ function sayHelloToBackend() {
911
source: 'react-devtools-content-script',
1012
hello: true,
1113
},
12-
'*'
14+
'*',
1315
);
1416
}
1517

@@ -19,7 +21,7 @@ function handleMessageFromDevtools(message) {
1921
source: 'react-devtools-content-script',
2022
payload: message,
2123
},
22-
'*'
24+
'*',
2325
);
2426
}
2527

@@ -48,12 +50,12 @@ function handleDisconnect() {
4850
event: 'shutdown',
4951
},
5052
},
51-
'*'
53+
'*',
5254
);
5355
}
5456

5557
// proxy from main page to devtools (via the background page)
56-
var port = chrome.runtime.connect({
58+
const port = chrome.runtime.connect({
5759
name: 'content-script',
5860
});
5961
port.onMessage.addListener(handleMessageFromDevtools);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ if (sessionStorageGetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY) === 'true') {
8585
// Inject a `__REACT_DEVTOOLS_GLOBAL_HOOK__` global so that React can detect that the
8686
// devtools are installed (and skip its suggestion to install the devtools).
8787
injectCode(
88-
';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact
88+
';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact,
8989
);

0 commit comments

Comments
 (0)