Enable ESLint Promise plugin defaults (#22229)

pull/23632/head
Nick Schonning 2023-02-16 01:30:56 -05:00 committed by GitHub
parent 29ec2c4fb5
commit 5e1c0c3d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ module.exports = {
'plugin:react/recommended', 'plugin:react/recommended',
'plugin:jsx-a11y/recommended', 'plugin:jsx-a11y/recommended',
'plugin:import/recommended', 'plugin:import/recommended',
'plugin:promise/recommended',
], ],
env: { env: {
@ -199,11 +200,15 @@ module.exports = {
], ],
'import/no-webpack-loader-syntax': 'error', 'import/no-webpack-loader-syntax': 'error',
'promise/always-return': 'off',
'promise/catch-or-return': [ 'promise/catch-or-return': [
'error', 'error',
{ {
allowFinally: true, allowFinally: true,
}, },
], ],
'promise/no-callback-in-promise': 'off',
'promise/no-nesting': 'off',
'promise/no-promise-in-callback': 'off',
}, },
}; };

View File

@ -3,7 +3,7 @@
const checkNotificationPromise = () => { const checkNotificationPromise = () => {
try { try {
// eslint-disable-next-line promise/catch-or-return // eslint-disable-next-line promise/catch-or-return, promise/valid-params
Notification.requestPermission().then(); Notification.requestPermission().then();
} catch(e) { } catch(e) {
return false; return false;