diff --git a/headless-tests/__tests__/headlessIntegrationTests.js b/headless-tests/__tests__/headlessIntegrationTests.js index df0bbf2fa..b5674b1f6 100644 --- a/headless-tests/__tests__/headlessIntegrationTests.js +++ b/headless-tests/__tests__/headlessIntegrationTests.js @@ -50,44 +50,43 @@ const basicArgs = [ params.insecurePort, ]; -const runHeadless = memoize( - (args: Array): Promise<{output: Object, stderr: string}> => { - return new Promise((resolve, reject) => { - const stdoutChunks = []; - const stderrChunks = []; - console.info(`Running ${params.bin} ${args.join(' ')}`); - const process = spawn(params.bin, args, {}); - process.stdout.setEncoding('utf8'); - process.stdout.on('data', chunk => { - stdoutChunks.push(chunk); - }); - process.stderr.on('data', chunk => { - stderrChunks.push(chunk); - }); - process.stdout.on('end', chunk => { - const stdout = stdoutChunks.join(''); - const stderr = stderrChunks.join(''); - try { - console.log(stderr); - resolve({output: JSON.parse(stdout), stderr: stderr}); - } catch (e) { - console.warn(stderr); - reject( - new Error( - `Failed to parse headless output as JSON (${ - e.message - }): ${stdout}`, - ), - ); - } - }); - - setTimeout(() => { - process.kill('SIGINT'); - }, 20000); +const runHeadless = memoize((args: Array): Promise<{ + output: Object, + stderr: string, +}> => { + return new Promise((resolve, reject) => { + const stdoutChunks = []; + const stderrChunks = []; + console.info(`Running ${params.bin} ${args.join(' ')}`); + const process = spawn(params.bin, args, {}); + process.stdout.setEncoding('utf8'); + process.stdout.on('data', chunk => { + stdoutChunks.push(chunk); }); - }, -); + process.stderr.on('data', chunk => { + stderrChunks.push(chunk); + }); + process.stdout.on('end', chunk => { + const stdout = stdoutChunks.join(''); + const stderr = stderrChunks.join(''); + try { + console.log(stderr); + resolve({output: JSON.parse(stdout), stderr: stderr}); + } catch (e) { + console.warn(stderr); + reject( + new Error( + `Failed to parse headless output as JSON (${e.message}): ${stdout}`, + ), + ); + } + }); + + setTimeout(() => { + process.kill('SIGINT'); + }, 20000); + }); +}); function getPluginState(app: string, plugin: string): Promise { return runHeadless(basicArgs).then(result => { diff --git a/package.json b/package.json index 6a345708b..b99ab4f8a 100644 --- a/package.json +++ b/package.json @@ -76,21 +76,21 @@ "babel-eslint": "^10.0.1", "electron": "^5.0.8", "electron-builder": "^20.38.5", - "eslint": "^6.3.0", - "eslint-config-fbjs": "^3.1.0", + "eslint": "^6.5.1", + "eslint-config-fbjs": "^3.1.1", "eslint-plugin-babel": "^5.3.0", - "eslint-plugin-flowtype": "^3.2.1", + "eslint-plugin-flowtype": "^4.3.0", "eslint-plugin-header": "^3.0.0", "eslint-plugin-import": "^2.18.0", "eslint-plugin-jsx-a11y": "^6.0.3", - "eslint-plugin-prettier": "^3.0.1", - "eslint-plugin-react": "^7.5.1", - "eslint-plugin-relay": "^1.0.0", + "eslint-plugin-prettier": "^3.1.1", + "eslint-plugin-react": "^7.16.0", + "eslint-plugin-relay": "^1.3.12", "flow-bin": "0.104.0", "glob": "^7.1.2", "jest": "^24.7.1", "jest-fetch-mock": "^2.1.0", - "prettier": "1.17.0", + "prettier": "^1.18.2", "redux-mock-store": "^1.5.3", "typescript": "^3.6.2" }, diff --git a/src/chrome/TitleBar.tsx b/src/chrome/TitleBar.tsx index a5c6bbc97..25a7a96d7 100644 --- a/src/chrome/TitleBar.tsx +++ b/src/chrome/TitleBar.tsx @@ -45,9 +45,7 @@ import {State} from 'src/reducers'; const AppTitleBar = styled(FlexRow)(({focused}: {focused?: boolean}) => ({ background: focused - ? `linear-gradient(to bottom, ${colors.macOSTitleBarBackgroundTop} 0%, ${ - colors.macOSTitleBarBackgroundBottom - } 100%)` + ? `linear-gradient(to bottom, ${colors.macOSTitleBarBackgroundTop} 0%, ${colors.macOSTitleBarBackgroundBottom} 100%)` : colors.macOSTitleBarBackgroundBlur, borderBottom: `1px solid ${ focused ? colors.macOSTitleBarBorder : colors.macOSTitleBarBorderBlur diff --git a/src/chrome/UpdateIndicator.tsx b/src/chrome/UpdateIndicator.tsx index 3a1b256e7..c3dcd57de 100644 --- a/src/chrome/UpdateIndicator.tsx +++ b/src/chrome/UpdateIndicator.tsx @@ -84,9 +84,7 @@ export default class UpdateIndicator extends React.PureComponent { return ( ); diff --git a/src/plugins/sections/EventsTable.js b/src/plugins/sections/EventsTable.js index 577e8a487..2105e75e3 100644 --- a/src/plugins/sections/EventsTable.js +++ b/src/plugins/sections/EventsTable.js @@ -38,9 +38,7 @@ const SurfaceContainer = styled(FlexColumn)(props => ({ bottom: 0, right: -15, width: 15, - background: `linear-gradient(90deg, ${ - colors.macOSTitleBarBackgroundBlur - } 0%, transparent 100%)`, + background: `linear-gradient(90deg, ${colors.macOSTitleBarBackgroundBlur} 0%, transparent 100%)`, zIndex: 3, position: 'absolute', }, diff --git a/src/reducers/connections.tsx b/src/reducers/connections.tsx index 5462dc8fd..0236ddd63 100644 --- a/src/reducers/connections.tsx +++ b/src/reducers/connections.tsx @@ -387,9 +387,7 @@ const reducer = (state: State = INITAL_STATE, action: Actions): State => { const errorMessage = payload.error instanceof Error ? payload.error.message : payload.error; console.error( - `Client setup error: ${errorMessage} while setting up client: ${ - payload.client.os - }:${payload.client.deviceName}:${payload.client.appName}`, + `Client setup error: ${errorMessage} while setting up client: ${payload.client.os}:${payload.client.deviceName}:${payload.client.appName}`, ); return { ...state, diff --git a/src/ui/components/Button.tsx b/src/ui/components/Button.tsx index 85c652ebb..d803ac012 100644 --- a/src/ui/components/Button.tsx +++ b/src/ui/components/Button.tsx @@ -63,17 +63,11 @@ const backgroundImage = (props: { }) => { if (props.windowIsFocused && !props.disabled) { if (props.depressed) { - return `linear-gradient(to bottom, ${ - colors.macOSTitleBarBorderBlur - } 1px, ${colors.macOSTitleBarButtonBorderBlur} 0%, ${ - colors.macOSTitleBarButtonBackgroundActive - } 100%)`; + return `linear-gradient(to bottom, ${colors.macOSTitleBarBorderBlur} 1px, ${colors.macOSTitleBarButtonBorderBlur} 0%, ${colors.macOSTitleBarButtonBackgroundActive} 100%)`; } else if (props.type === 'primary') { return `linear-gradient(to bottom, #67a6f7 0%, #0072FA 100%)`; } else { - return `linear-gradient(to bottom, transparent 0%,${ - colors.macOSTitleBarButtonBackground - } 100%)`; + return `linear-gradient(to bottom, transparent 0%,${colors.macOSTitleBarButtonBackground} 100%)`; } } else { return 'none'; @@ -171,11 +165,7 @@ const StyledButton = styled('div')( : { borderColor: colors.macOSTitleBarButtonBorder, borderBottomColor: colors.macOSTitleBarButtonBorderBottom, - background: `linear-gradient(to bottom, ${ - colors.macOSTitleBarButtonBackgroundActiveHighlight - } 1px, ${colors.macOSTitleBarButtonBackgroundActive} 0%, ${ - colors.macOSTitleBarButtonBorderBlur - } 100%)`, + background: `linear-gradient(to bottom, ${colors.macOSTitleBarButtonBackgroundActiveHighlight} 1px, ${colors.macOSTitleBarButtonBackgroundActive} 0%, ${colors.macOSTitleBarButtonBorderBlur} 100%)`, }, '&:disabled': { @@ -191,9 +181,7 @@ const StyledButton = styled('div')( right: 2, borderStyle: 'solid', borderWidth: '4px 3px 0 3px', - borderColor: `${ - colors.macOSTitleBarIcon - } transparent transparent transparent`, + borderColor: `${colors.macOSTitleBarIcon} transparent transparent transparent`, }, }), ); diff --git a/src/ui/components/Tabs.tsx b/src/ui/components/Tabs.tsx index 5a477aacf..af29471bb 100644 --- a/src/ui/components/Tabs.tsx +++ b/src/ui/components/Tabs.tsx @@ -31,9 +31,7 @@ const TabListItem = styled('div')( background: props.container ? props.active ? 'linear-gradient(to bottom, #67a6f7 0%, #0072FA 100%)' - : `linear-gradient(to bottom, white 0%,${ - colors.macOSTitleBarButtonBackgroundBlur - } 100%)` + : `linear-gradient(to bottom, white 0%,${colors.macOSTitleBarButtonBackgroundBlur} 100%)` : props.active ? colors.light15 : colors.light02, diff --git a/src/utils/exportData.tsx b/src/utils/exportData.tsx index ede6b4d07..9f1962384 100644 --- a/src/utils/exportData.tsx +++ b/src/utils/exportData.tsx @@ -289,9 +289,7 @@ const addSaltToDeviceSerial = async ( const updatedPluginNotifications = pluginNotification.map(notif => { if (!notif.client || !notif.client.includes(serial)) { throw new Error( - `Error while exporting, plugin state (${ - notif.pluginId - }) does not have ${serial} in it`, + `Error while exporting, plugin state (${notif.pluginId}) does not have ${serial} in it`, ); } return {...notif, client: notif.client.replace(serial, newSerial)}; diff --git a/src/utils/icons.js b/src/utils/icons.js index bbfdfa7e1..e56bf44fe 100644 --- a/src/utils/icons.js +++ b/src/utils/icons.js @@ -77,11 +77,7 @@ function buildLocalIconPath(name, size, density) { // $FlowFixMe not using flow in this file function buildIconURL(name, size, density) { const icon = getIconPartsFromName(name); - const url = `https://external.xx.fbcdn.net/assets/?name=${ - icon.trimmedName - }&variant=${ - icon.variant - }&size=${size}&set=facebook_icons&density=${density}x`; + const url = `https://external.xx.fbcdn.net/assets/?name=${icon.trimmedName}&variant=${icon.variant}&size=${size}&set=facebook_icons&density=${density}x`; if ( typeof window !== 'undefined' && (!ICONS[name] || !ICONS[name].includes(size)) diff --git a/src/utils/jsonFileReduxPersistStorage.tsx b/src/utils/jsonFileReduxPersistStorage.tsx index ae883662a..2ba5b788a 100644 --- a/src/utils/jsonFileReduxPersistStorage.tsx +++ b/src/utils/jsonFileReduxPersistStorage.tsx @@ -33,9 +33,7 @@ export default class JsonFileStorage { .then(this.deserializeValue) .catch(e => { console.warn( - `Failed to read settings file: "${ - this.filepath - }". ${e}. Replacing file with default settings.`, + `Failed to read settings file: "${this.filepath}". ${e}. Replacing file with default settings.`, ); return this.writeContents(JSON.stringify({})).then(() => ({})); }); diff --git a/yarn.lock b/yarn.lock index dea788473..3e0e419e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3562,10 +3562,10 @@ escodegen@^1.9.1, escodegen@~1.11.1: optionalDependencies: source-map "~0.6.1" -eslint-config-fbjs@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-fbjs/-/eslint-config-fbjs-3.1.0.tgz#d35ee27be42cbf27437d2e36de027a3aa231cd2c" - integrity sha512-YtYulNvxJFNPnOIrdrXIz8xul3dOsx/ZuFnR2fsNEeDLrDcDoFQ23bzm1jdp9ZZuQJm+k4/MDNng1eVeBX47cg== +eslint-config-fbjs@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-fbjs/-/eslint-config-fbjs-3.1.1.tgz#f5b4c1df888693672116f000527a8df25d61b888" + integrity sha512-Vpyqz+ZcyLyiUGUdUfiQmZnxiQ4Nj/KDRKed/Y5qSm+xHbQJ5zcZUQwLUMWHQicpDHewsdXwlpUAblvy1DtGvg== eslint-import-resolver-node@^0.3.2: version "0.3.2" @@ -3590,12 +3590,12 @@ eslint-plugin-babel@^5.3.0: dependencies: eslint-rule-composer "^0.3.0" -eslint-plugin-flowtype@^3.2.1: - version "3.12.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.12.2.tgz#f02fb8a4e20993bff860292bdd39b93d511d7326" - integrity sha512-Fky+noPK7WPEAuclGRBsRHNukmSc9h2cUMpht9+tVd30YoJwz3xK7ma1QQ69wIjVTbk2N0sA6QjEo2DlIf9LlA== +eslint-plugin-flowtype@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-4.3.0.tgz#06d0837ac341caf369e7e6dbb112dd7fd21acf17" + integrity sha512-elvqoadMHnYqSYN1YXn02DR7SFW8Kc2CLe8na3m2GdQPQhIY+BgCd2quVJ1AbW3aO0zcyE9loVJ7Szy8A/xlMA== dependencies: - lodash "^4.17.11" + lodash "^4.17.15" eslint-plugin-header@^3.0.0: version "3.0.0" @@ -3634,32 +3634,32 @@ eslint-plugin-jsx-a11y@^6.0.3: has "^1.0.3" jsx-ast-utils "^2.2.1" -eslint-plugin-prettier@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" - integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== +eslint-plugin-prettier@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz#507b8562410d02a03f0ddc949c616f877852f2ba" + integrity sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA== dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react@^7.5.1: - version "7.14.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.3.tgz#911030dd7e98ba49e1b2208599571846a66bdf13" - integrity sha512-EzdyyBWC4Uz2hPYBiEJrKCUi2Fn+BJ9B/pJQcjw5X+x/H2Nm59S4MJIvL4O5NEE0+WbnQwEBxWY03oUk+Bc3FA== +eslint-plugin-react@^7.16.0: + version "7.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.16.0.tgz#9928e4f3e2122ed3ba6a5b56d0303ba3e41d8c09" + integrity sha512-GacBAATewhhptbK3/vTP09CbFrgUJmBSaaRcWdbQLFvUZy9yVcQxigBNHGPU/KE2AyHpzj3AWXpxoMTsIDiHug== dependencies: array-includes "^3.0.3" doctrine "^2.1.0" has "^1.0.3" - jsx-ast-utils "^2.1.0" + jsx-ast-utils "^2.2.1" object.entries "^1.1.0" object.fromentries "^2.0.0" object.values "^1.1.0" prop-types "^15.7.2" - resolve "^1.10.1" + resolve "^1.12.0" -eslint-plugin-relay@^1.0.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-relay/-/eslint-plugin-relay-1.3.5.tgz#7c23d78601d9cf0c8ec9e339f3d03206051d0476" - integrity sha512-/1sLf+ljAcESqJJxZzTeFlFF/MtFYaghEka/CZqall0bCGrCWyyhfO58G7k5zQWsM5xQwWaw/g+aWmbuTLOCXg== +eslint-plugin-relay@^1.3.12: + version "1.3.12" + resolved "https://registry.yarnpkg.com/eslint-plugin-relay/-/eslint-plugin-relay-1.3.12.tgz#1e7d936386650ccc7709c8f6eeb0210e0e226527" + integrity sha512-276RrlyF0112Mz8PbaDvYKmqBGYEm0WBCfMNunnm6jHQ0aClUbPUmNctJXpFjfurcZfNEOz22Nx3VUMVDIGIkw== dependencies: graphql "^14.0.0" @@ -3696,10 +3696,10 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== -eslint@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.3.0.tgz#1f1a902f67bfd4c354e7288b81e40654d927eb6a" - integrity sha512-ZvZTKaqDue+N8Y9g0kp6UPZtS4FSY3qARxBs7p4f0H0iof381XHduqVerFWtK8DPtKmemqbqCFENWSQgPR/Gow== +eslint@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.5.1.tgz#828e4c469697d43bb586144be152198b91e96ed6" + integrity sha512-32h99BoLYStT1iq1v2P9uwpyznQ4M2jRiFB6acitKz52Gqn+vPaMDUTB1bYi1WN4Nquj2w+t+bimYUG83DC55A== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -5809,7 +5809,7 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -jsx-ast-utils@^2.1.0, jsx-ast-utils@^2.2.1: +jsx-ast-utils@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz#4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb" integrity sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ== @@ -6052,7 +6052,7 @@ lodash.unescape@4.0.1: resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= -lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.2.0: +lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.2.0: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -7204,12 +7204,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008" - integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw== - -prettier@^1.14.2: +prettier@^1.14.2, prettier@^1.18.2: version "1.18.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== @@ -7993,13 +7988,20 @@ resolve@1.6.0: dependencies: path-parse "^1.0.5" -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0: version "1.11.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: path-parse "^1.0.6" +resolve@^1.12.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" + integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== + dependencies: + path-parse "^1.0.6" + responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"