about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-16 01:30:56 -0500
committerGitHub <noreply@github.com>2023-02-16 15:30:56 +0900
commit5e1c0c3d946bef488f8e156ed3b5034740e731df (patch)
tree27766d9c4c29bd99a13782e9cde42384a7ef0e3e
parent29ec2c4fb513b54eec66606a7608a44e782986d5 (diff)
Enable ESLint Promise plugin defaults (#22229)
-rw-r--r--.eslintrc.js5
-rw-r--r--app/javascript/mastodon/utils/notifications.js2
2 files changed, 6 insertions, 1 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index 4d81aa47e..b5ab511f8 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -6,6 +6,7 @@ module.exports = {
     'plugin:react/recommended',
     'plugin:jsx-a11y/recommended',
     'plugin:import/recommended',
+    'plugin:promise/recommended',
   ],
 
   env: {
@@ -199,11 +200,15 @@ module.exports = {
     ],
     'import/no-webpack-loader-syntax': 'error',
 
+    'promise/always-return': 'off',
     'promise/catch-or-return': [
       'error',
       {
         allowFinally: true,
       },
     ],
+    'promise/no-callback-in-promise': 'off',
+    'promise/no-nesting': 'off',
+    'promise/no-promise-in-callback': 'off',
   },
 };
diff --git a/app/javascript/mastodon/utils/notifications.js b/app/javascript/mastodon/utils/notifications.js
index 7634cac21..3cdf7caea 100644
--- a/app/javascript/mastodon/utils/notifications.js
+++ b/app/javascript/mastodon/utils/notifications.js
@@ -3,7 +3,7 @@
 
 const checkNotificationPromise = () => {
   try {
-    // eslint-disable-next-line promise/catch-or-return
+    // eslint-disable-next-line promise/catch-or-return, promise/valid-params
     Notification.requestPermission().then();
   } catch(e) {
     return false;