diff --git a/desktop/.eslintrc.js b/desktop/.eslintrc.js index 5acab8321..284cd6d59 100644 --- a/desktop/.eslintrc.js +++ b/desktop/.eslintrc.js @@ -43,6 +43,7 @@ module.exports = { 'node', 'react-hooks', 'flipper', + 'promise', ], rules: { // disable rules from eslint-config-fbjs @@ -96,6 +97,14 @@ module.exports = { 'flipper/no-relative-imports-across-packages': [2], 'flipper/no-electron-remote-imports': [1], 'flipper/no-console-error-without-context': [1], + + // promise rules, see https://github.com/xjamundx/eslint-plugin-promise for details on each of them + 'promise/catch-or-return': 'warn', + 'promise/no-nesting': 'warn', + 'promise/no-promise-in-callback': 'warn', + 'promise/no-callback-in-promise': 'warn', + 'promise/no-return-in-finally': 'warn', + 'promise/valid-params': 'error', }, settings: { 'import/resolver': { diff --git a/desktop/package.json b/desktop/package.json index 815a742d0..0e7469bdf 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -147,6 +147,7 @@ "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", + "eslint-plugin-promise": "^5.1.0", "eslint-plugin-react": "^7.23.2", "eslint-plugin-react-hooks": "^4.2.0", "expand-tilde": "^2.0.2", diff --git a/desktop/static/main.ts b/desktop/static/main.ts index e2b9a4108..6a77ef774 100644 --- a/desktop/static/main.ts +++ b/desktop/static/main.ts @@ -193,9 +193,11 @@ app.on('ready', () => { console.log('Force updating DevTools'); } // Redux - await installExtension(REDUX_DEVTOOLS.id).catch((e: any) => { + await installExtension(REDUX_DEVTOOLS.id, { + loadExtensionOptions: {allowFileAccess: true, forceDownload}, + }).catch((e: any) => { console.error('Failed to install Redux devtools extension', e); - }, forceDownload); + }); // React // Fix for extension loading (see D27685981) // Work around per https://github.com/electron/electron/issues/23662#issuecomment-787420799 diff --git a/desktop/yarn.lock b/desktop/yarn.lock index 6c5da9ced..61447caa0 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -6049,6 +6049,11 @@ eslint-plugin-prettier@^3.4.0: dependencies: prettier-linter-helpers "^1.0.0" +eslint-plugin-promise@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz#fb2188fb734e4557993733b41aa1a688f46c6f24" + integrity sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng== + eslint-plugin-react-hooks@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"