diff --git a/desktop/app/src/__tests__/PluginContainer.node.tsx b/desktop/app/src/__tests__/PluginContainer.node.tsx index 92f358372..f207f26c6 100644 --- a/desktop/app/src/__tests__/PluginContainer.node.tsx +++ b/desktop/app/src/__tests__/PluginContainer.node.tsx @@ -209,9 +209,9 @@ test('PluginContainer can render Sandy plugins', async () => { `); // make sure the plugin gets connected - const pluginInstance: ReturnType = client.sandyPluginStates.get( - definition.id, - )!.instanceApi; + const pluginInstance: ReturnType< + typeof plugin + > = client.sandyPluginStates.get(definition.id)!.instanceApi; expect(pluginInstance.connectedStub).toBeCalledTimes(1); expect(pluginInstance.disconnectedStub).toBeCalledTimes(0); expect(pluginInstance.activatedStub).toBeCalledTimes(1); @@ -357,9 +357,9 @@ test('PluginContainer triggers correct lifecycles for background plugin', async expect(client.rawSend).toBeCalledWith('init', {plugin: 'TestPlugin'}); (client.rawSend as jest.Mock).mockClear(); // make sure the plugin gets connected - const pluginInstance: ReturnType = client.sandyPluginStates.get( - definition.id, - )!.instanceApi; + const pluginInstance: ReturnType< + typeof plugin + > = client.sandyPluginStates.get(definition.id)!.instanceApi; expect(pluginInstance.connectedStub).toBeCalledTimes(1); expect(pluginInstance.disconnectedStub).toBeCalledTimes(0); expect(pluginInstance.activatedStub).toBeCalledTimes(1); @@ -438,9 +438,9 @@ test('PluginContainer triggers correct lifecycles for background plugin', async expect(pluginInstance.activatedStub).toBeCalledTimes(2); expect(pluginInstance.deactivatedStub).toBeCalledTimes(2); - const newPluginInstance: ReturnType = client.sandyPluginStates.get( - 'TestPlugin', - )!.instanceApi; + const newPluginInstance: ReturnType< + typeof plugin + > = client.sandyPluginStates.get('TestPlugin')!.instanceApi; expect(newPluginInstance.connectedStub).toBeCalledTimes(1); expect(newPluginInstance.disconnectedStub).toBeCalledTimes(0); expect(newPluginInstance.activatedStub).toBeCalledTimes(0); @@ -699,9 +699,9 @@ test('PluginContainer can render Sandy device plugins', async () => { `); // make sure the plugin gets connected - const pluginInstance: ReturnType = device.sandyPluginStates.get( - definition.id, - )!.instanceApi; + const pluginInstance: ReturnType< + typeof devicePlugin + > = device.sandyPluginStates.get(definition.id)!.instanceApi; expect(pluginInstance.activatedStub).toBeCalledTimes(1); expect(pluginInstance.deactivatedStub).toBeCalledTimes(0); @@ -949,9 +949,9 @@ test('Sandy plugins support isPluginSupported + selectPlugin', async () => { `); expect(renders).toBe(1); - const pluginInstance: ReturnType = client.sandyPluginStates.get( - definition.id, - )!.instanceApi; + const pluginInstance: ReturnType< + typeof plugin + > = client.sandyPluginStates.get(definition.id)!.instanceApi; expect(pluginInstance.isPluginAvailable(definition.id)).toBeTruthy(); expect(pluginInstance.isPluginAvailable('nonsense')).toBeFalsy(); expect(pluginInstance.isPluginAvailable(definition2.id)).toBeFalsy(); // not enabled yet diff --git a/desktop/app/src/chrome/UpdateIndicator.tsx b/desktop/app/src/chrome/UpdateIndicator.tsx index 07e15611c..588173335 100644 --- a/desktop/app/src/chrome/UpdateIndicator.tsx +++ b/desktop/app/src/chrome/UpdateIndicator.tsx @@ -32,9 +32,10 @@ export type VersionCheckResult = }; export default function UpdateIndicator() { - const [versionCheckResult, setVersionCheckResult] = useState< - VersionCheckResult - >({kind: 'up-to-date'}); + const [ + versionCheckResult, + setVersionCheckResult, + ] = useState({kind: 'up-to-date'}); const launcherMsg = useStore((state) => state.application.launcherMsg); // Effect to show notification if details change diff --git a/desktop/app/src/sandy-chrome/SandyApp.tsx b/desktop/app/src/sandy-chrome/SandyApp.tsx index 6407e3c5d..e4659a0b0 100644 --- a/desktop/app/src/sandy-chrome/SandyApp.tsx +++ b/desktop/app/src/sandy-chrome/SandyApp.tsx @@ -63,9 +63,10 @@ export function SandyApp() { * The logic here is to sync both, but without modifying the navigation related reducers to not break classic Flipper. * It is possible to simplify this in the future. */ - const [toplevelSelection, setStoredToplevelSelection] = useState< - ToplevelNavItem - >('appinspect'); + const [ + toplevelSelection, + setStoredToplevelSelection, + ] = useState('appinspect'); // Handle toplevel nav clicks from LeftRail const setToplevelSelection = useCallback( diff --git a/desktop/app/src/ui/components/StackTrace.tsx b/desktop/app/src/ui/components/StackTrace.tsx index ee58c2007..bf265f341 100644 --- a/desktop/app/src/ui/components/StackTrace.tsx +++ b/desktop/app/src/ui/components/StackTrace.tsx @@ -115,9 +115,9 @@ export default class StackTrace extends Component<{ return null; } - const columns = (Object.keys(children[0]) as Array).reduce< - TableColumns - >((acc, cv) => { + const columns = (Object.keys(children[0]) as Array< + keyof Child + >).reduce((acc, cv) => { if (cv !== 'isBold') { acc[cv] = { value: cv, diff --git a/desktop/app/src/ui/components/elements-inspector/ElementsInspector.tsx b/desktop/app/src/ui/components/elements-inspector/ElementsInspector.tsx index cebd90a92..5251c0d58 100644 --- a/desktop/app/src/ui/components/elements-inspector/ElementsInspector.tsx +++ b/desktop/app/src/ui/components/elements-inspector/ElementsInspector.tsx @@ -80,9 +80,7 @@ export type ElementsInspectorProps = { decorateRow?: DecorateRow; }; -export default class ElementsInspector extends Component< - ElementsInspectorProps -> { +export default class ElementsInspector extends Component { static defaultProps = { alternateRowColor: true, }; diff --git a/desktop/babel-transformer/package.json b/desktop/babel-transformer/package.json index e103240a9..758cde1b2 100644 --- a/desktop/babel-transformer/package.json +++ b/desktop/babel-transformer/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@types/jest": "26", "jest": "^26", - "prettier": "^2.0.0", + "prettier": "^2.2.1", "rimraf": "^3.0.2", "ts-jest": "^26.0.0", "ts-node": "^8", diff --git a/desktop/doctor/package.json b/desktop/doctor/package.json index 8986e0c03..322faa765 100644 --- a/desktop/doctor/package.json +++ b/desktop/doctor/package.json @@ -17,7 +17,7 @@ "eslint-plugin-prettier": "^3.1.1", "eslint-plugin-react": "^7.21.5", "jest": "^26", - "prettier": "^2.0.0", + "prettier": "^2.2.1", "ts-jest": "^26.0.0", "tslint-config-prettier": "^1.18.0", "typescript": "^4.1.2" diff --git a/desktop/eslint-plugin-flipper/package.json b/desktop/eslint-plugin-flipper/package.json index 40452ce40..a8dddbe1d 100644 --- a/desktop/eslint-plugin-flipper/package.json +++ b/desktop/eslint-plugin-flipper/package.json @@ -15,10 +15,10 @@ }, "devDependencies": { "@types/jest": "26", - "@typescript-eslint/parser": "^4.2.0", + "@typescript-eslint/parser": "^4.14.2", "flipper-test-utils": "0.0.0", "jest": "^26", - "prettier": "^2.0.0", + "prettier": "^2.2.1", "rimraf": "^3.0.2", "ts-jest": "^26.0.0", "ts-node": "^8", diff --git a/desktop/package.json b/desktop/package.json index 46b171cde..95fd081cb 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -216,7 +216,7 @@ "node-fetch": "^2.6.1", "p-filter": "^2.1.0", "p-map": "^4.0.0", - "prettier": "^2.0.0", + "prettier": "^2.2.1", "pretty-format": "^26.1.0", "promisify-child-process": "^4.1.0", "react-async": "^10.0.0", diff --git a/desktop/pkg-lib/package.json b/desktop/pkg-lib/package.json index 422fa0e68..2606d9f83 100644 --- a/desktop/pkg-lib/package.json +++ b/desktop/pkg-lib/package.json @@ -22,7 +22,7 @@ "globby": "^11", "jest": "^26", "mock-fs": "^4.13.0", - "prettier": "^2.0.0", + "prettier": "^2.2.1", "rimraf": "^3.0.2", "ts-jest": "^26.0.0", "ts-node": "^8", diff --git a/desktop/pkg/package.json b/desktop/pkg/package.json index ddb39b9e3..39b4ed394 100644 --- a/desktop/pkg/package.json +++ b/desktop/pkg/package.json @@ -37,7 +37,7 @@ "flipper-test-utils": "0.0.0", "globby": "^11", "jest": "^26", - "prettier": "^2.0.0", + "prettier": "^2.2.1", "rimraf": "^3.0.2", "ts-jest": "^26.0.0", "ts-node": "^8", diff --git a/desktop/plugin-lib/src/pluginInstaller.ts b/desktop/plugin-lib/src/pluginInstaller.ts index e3a214c46..46df3b823 100644 --- a/desktop/plugin-lib/src/pluginInstaller.ts +++ b/desktop/plugin-lib/src/pluginInstaller.ts @@ -212,9 +212,7 @@ export async function moveInstalledPluginsFromLegacyDir() { type InstalledPluginVersionDirs = [string, string[]][]; -async function getInstalledPluginVersionDirs(): Promise< - InstalledPluginVersionDirs -> { +async function getInstalledPluginVersionDirs(): Promise { if (!(await fs.pathExists(pluginInstallationDir))) { return []; } diff --git a/desktop/plugins/hermesdebuggerrn/ChromeDevTools.tsx b/desktop/plugins/hermesdebuggerrn/ChromeDevTools.tsx index bf536a2bc..4746bfacd 100644 --- a/desktop/plugins/hermesdebuggerrn/ChromeDevTools.tsx +++ b/desktop/plugins/hermesdebuggerrn/ChromeDevTools.tsx @@ -87,9 +87,7 @@ type ChromeDevToolsProps = { marginTop: string | null; }; -export default class ChromeDevTools extends React.Component< - ChromeDevToolsProps -> { +export default class ChromeDevTools extends React.Component { createDevTools(url: string, marginTop: string | null) { const devToolsNode = createDevToolsNode(url, marginTop); attachDevTools(devToolsNode); diff --git a/desktop/plugins/kaios-allocations/index.tsx b/desktop/plugins/kaios-allocations/index.tsx index e1e821588..e20700a56 100644 --- a/desktop/plugins/kaios-allocations/index.tsx +++ b/desktop/plugins/kaios-allocations/index.tsx @@ -82,12 +82,13 @@ Memory.prototype = extend(ClientMethods, { }, startRecordingAllocations: function (options: any, cb: any) { - this.request('startRecordingAllocations', {options}, function ( - err: any, - resp: any, - ) { - cb(err, resp); - }); + this.request( + 'startRecordingAllocations', + {options}, + function (err: any, resp: any) { + cb(err, resp); + }, + ); }, stopRecordingAllocations: function (cb: any) { diff --git a/desktop/yarn.lock b/desktop/yarn.lock index dce23c90f..00f70f4e5 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -2813,16 +2813,6 @@ "@typescript-eslint/typescript-estree" "4.14.2" debug "^4.1.1" -"@typescript-eslint/parser@^4.2.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.4.0.tgz#65974db9a75f23b036f17b37e959b5f99b659ec0" - integrity sha512-yc14iEItCxoGb7W4Nx30FlTyGpU9r+j+n1LUK/exlq2eJeFxczrz/xFRZUk2f6yzWfK+pr1DOTyQnmDkcC4TnA== - dependencies: - "@typescript-eslint/scope-manager" "4.4.0" - "@typescript-eslint/types" "4.4.0" - "@typescript-eslint/typescript-estree" "4.4.0" - debug "^4.1.1" - "@typescript-eslint/scope-manager@4.13.0": version "4.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.13.0.tgz#5b45912a9aa26b29603d8fa28f5e09088b947141" @@ -2839,14 +2829,6 @@ "@typescript-eslint/types" "4.14.2" "@typescript-eslint/visitor-keys" "4.14.2" -"@typescript-eslint/scope-manager@4.4.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.4.0.tgz#2f3dd27692a12cc9a046a90ba6a9d8cb7731190a" - integrity sha512-r2FIeeU1lmW4K3CxgOAt8djI5c6Q/5ULAgdVo9AF3hPMpu0B14WznBAtxrmB/qFVbVIB6fSx2a+EVXuhSVMEyA== - dependencies: - "@typescript-eslint/types" "4.4.0" - "@typescript-eslint/visitor-keys" "4.4.0" - "@typescript-eslint/types@4.13.0": version "4.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.13.0.tgz#6a7c6015a59a08fbd70daa8c83dfff86250502f8" @@ -2857,11 +2839,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.2.tgz#d96da62be22dc9dc6a06647f3633815350fb3174" integrity sha512-LltxawRW6wXy4Gck6ZKlBD05tCHQUj4KLn4iR69IyRiDHX3d3NCAhO+ix5OR2Q+q9bjCrHE/HKt+riZkd1At8Q== -"@typescript-eslint/types@4.4.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.4.0.tgz#63440ef87a54da7399a13bdd4b82060776e9e621" - integrity sha512-nU0VUpzanFw3jjX+50OTQy6MehVvf8pkqFcURPAE06xFNFenMj1GPEI6IESvp7UOHAnq+n/brMirZdR+7rCrlA== - "@typescript-eslint/typescript-estree@4.13.0": version "4.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.13.0.tgz#cf6e2207c7d760f5dfd8d18051428fadfc37b45e" @@ -2890,20 +2867,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@4.4.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.4.0.tgz#16a2df7c16710ddd5406b32b86b9c1124b1ca526" - integrity sha512-Fh85feshKXwki4nZ1uhCJHmqKJqCMba+8ZicQIhNi5d5jSQFteWiGeF96DTjO8br7fn+prTP+t3Cz/a/3yOKqw== - dependencies: - "@typescript-eslint/types" "4.4.0" - "@typescript-eslint/visitor-keys" "4.4.0" - debug "^4.1.1" - globby "^11.0.1" - is-glob "^4.0.1" - lodash "^4.17.15" - semver "^7.3.2" - tsutils "^3.17.1" - "@typescript-eslint/visitor-keys@4.13.0": version "4.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.13.0.tgz#9acb1772d3b3183182b6540d3734143dce9476fe" @@ -2920,14 +2883,6 @@ "@typescript-eslint/types" "4.14.2" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@4.4.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.4.0.tgz#0a9118344082f14c0f051342a74b42dfdb012640" - integrity sha512-oBWeroUZCVsHLiWRdcTXJB7s1nB3taFY8WGvS23tiAlT6jXVvsdAV4rs581bgdEjOhn43q6ro7NkOiLKu6kFqA== - dependencies: - "@typescript-eslint/types" "4.4.0" - eslint-visitor-keys "^2.0.0" - "@yarnpkg/lockfile@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" @@ -9961,10 +9916,10 @@ prettier@^1.14.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== -prettier@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" - integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== +prettier@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== pretty-format@^25.5.0: version "25.5.0"