Skip to content

Commit

Permalink
Fixed a bunch of Lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Aug 14, 2019
1 parent 51626ae commit ac2e861
Show file tree
Hide file tree
Showing 140 changed files with 253 additions and 305 deletions.
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ scripts/bench/benchmarks/**/*.js

# React repository clone
scripts/bench/remote-repo/

packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
packages/react-devtools-extensions/firefox/build
packages/react-devtools-extensions/shared/build
packages/react-devtools-inline/dist
packages/react-devtools-shell/dist
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ chrome-user-data
.vscode
*.swp
*.swo

packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
packages/react-devtools-extensions/chrome/*.crx
packages/react-devtools-extensions/chrome/*.pem
packages/react-devtools-extensions/firefox/build
packages/react-devtools-extensions/firefox/*.xpi
packages/react-devtools-extensions/firefox/*.pem
packages/react-devtools-extensions/shared/build
packages/react-devtools-inline/dist
packages/react-devtools-shell/dist
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
packages/react-devtools-core/dist
packages/react-devtools-extensions/chrome/build
packages/react-devtools-extensions/firefox/build
packages/react-devtools-extensions/shared/build
packages/react-devtools-inline/dist
packages/react-devtools-shell/dist
2 changes: 1 addition & 1 deletion packages/react-devtools-core/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
}
} catch (e) {
console.error(
'[React DevTools] Failed to parse JSON: ' + String(event.data),
'[React DevTools] Failed to parse JSON: ' + (event.data: any),
);
return;
}
Expand Down
13 changes: 0 additions & 13 deletions packages/react-devtools-extensions/.eslintignore

This file was deleted.

19 changes: 0 additions & 19 deletions packages/react-devtools-extensions/.eslintrc

This file was deleted.

35 changes: 0 additions & 35 deletions packages/react-devtools-extensions/.flowconfig

This file was deleted.

21 changes: 0 additions & 21 deletions packages/react-devtools-extensions/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions packages/react-devtools-extensions/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/react-devtools-extensions/.prettierrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const archiver = require('archiver');
const {execSync} = require('child_process');
const {readFileSync, writeFileSync, createWriteStream} = require('fs');
Expand Down Expand Up @@ -28,23 +30,23 @@ const build = async (tempPath, manifestPath) => {
'..',
'node_modules',
'.bin',
'webpack'
'webpack',
);
execSync(
`${webpackPath} --config webpack.config.js --output-path ${binPath}`,
{
cwd: __dirname,
env: process.env,
stdio: 'inherit',
}
},
);
execSync(
`${webpackPath} --config webpack.backend.js --output-path ${binPath}`,
{
cwd: __dirname,
env: process.env,
stdio: 'inherit',
}
},
);

// Make temp dir
Expand All @@ -56,7 +58,7 @@ const build = async (tempPath, manifestPath) => {
await copy(binPath, join(zipPath, 'build'));
await copy(manifestPath, copiedManifestPath);
await Promise.all(
STATIC_FILES.map(file => copy(join(__dirname, file), join(zipPath, file)))
STATIC_FILES.map(file => copy(join(__dirname, file), join(zipPath, file))),
);

const commit = getGitCommit();
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-extensions/chrome/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const chalk = require('chalk');
const {execSync} = require('child_process');
const {existsSync} = require('fs');
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-extensions/chrome/deploy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const deploy = require('../shared/deploy');

const main = async () => await deploy('chrome');
Expand Down
4 changes: 3 additions & 1 deletion packages/react-devtools-extensions/chrome/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node

const chromeLaunch = require('chrome-launch'); // eslint-disable-line import/no-extraneous-dependencies
'use strict';

const chromeLaunch = require('chrome-launch');
const {resolve} = require('path');

const EXTENSION_PATH = resolve('shells/browser/chrome/build/unpacked');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const {exec, execSync} = require('child_process');
const {readFileSync, writeFileSync} = require('fs');
const {join} = require('path');
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-extensions/firefox/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const chalk = require('chalk');
const build = require('../shared/build');

Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-extensions/firefox/deploy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const deploy = require('../shared/deploy');

const main = async () => await deploy('firefox');
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-extensions/firefox/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

const {exec} = require('child-process-promise');
const {Finder} = require('firefox-profile');
const {resolve} = require('path');
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-extensions/flow-typed/chrome.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @flow

'use strict';

declare var chrome: {
devtools: {
network: {
Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-extensions/flow-typed/jest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

type JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {
(...args: TArguments): TReturn,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// Type definitions for react-test-renderer 16.x.x
// Ported from: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer

'use strict';

type ReactComponentInstance = React$Component<any>;

type ReactTestRendererJSON = {
Expand Down
1 change: 0 additions & 1 deletion packages/react-devtools-extensions/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ declare module 'node-events' {
}

declare var __DEV__: boolean;
declare var __TEST__: boolean;

declare var jasmine: {|
getEnv: () => {|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* globals chrome */

'use strict';

document.addEventListener('DOMContentLoaded', function() {
// Make links work
const links = document.getElementsByTagName('a');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

/** @flow */

'use strict';

function welcome(event) {
if (
event.source !== window ||
Expand Down Expand Up @@ -51,7 +53,7 @@ function setup(hook) {
payload: {event, payload},
},
'*',
transferable
transferable,
);
},
});
Expand All @@ -66,12 +68,12 @@ function setup(hook) {
initBackend(hook, agent, window);

// Setup React Native style editor if a renderer like react-native-web has injected it.
if (!!hook.resolveRNStyle) {
if (hook.resolveRNStyle) {
setupNativeStyleEditor(
bridge,
agent,
hook.resolveRNStyle,
hook.nativeStyleEditorValidAttributes
hook.nativeStyleEditorValidAttributes,
);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* global chrome */

'use strict';

const ports = {};

const IS_FIREFOX = navigator.userAgent.indexOf('Firefox') >= 0;
Expand Down Expand Up @@ -37,7 +39,7 @@ function installContentScript(tabId: number) {
chrome.tabs.executeScript(
tabId,
{file: '/build/contentScript.js'},
function() {}
function() {},
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* global chrome */

'use strict';

let backendDisconnected: boolean = false;
let backendInitialized: boolean = false;

Expand All @@ -9,7 +11,7 @@ function sayHelloToBackend() {
source: 'react-devtools-content-script',
hello: true,
},
'*'
'*',
);
}

Expand All @@ -19,7 +21,7 @@ function handleMessageFromDevtools(message) {
source: 'react-devtools-content-script',
payload: message,
},
'*'
'*',
);
}

Expand Down Expand Up @@ -48,12 +50,12 @@ function handleDisconnect() {
event: 'shutdown',
},
},
'*'
'*',
);
}

// proxy from main page to devtools (via the background page)
var port = chrome.runtime.connect({
const port = chrome.runtime.connect({
name: 'content-script',
});
port.onMessage.addListener(handleMessageFromDevtools);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ if (sessionStorageGetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY) === 'true') {
// Inject a `__REACT_DEVTOOLS_GLOBAL_HOOK__` global so that React can detect that the
// devtools are installed (and skip its suggestion to install the devtools).
injectCode(
';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact
';(' + installHook.toString() + '(window))' + saveNativeValues + detectReact,
);
Loading

0 comments on commit ac2e861

Please sign in to comment.