eslint-community / eslint-plugin-promise

Enforce best practices for JavaScript promises

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no-return-wrap doesn't work for arrow functions without braces

cherryblossom000 opened this issue · comments

Description

no-return-wrap doesn't work for arrow functions without braces.

Steps to Reproduce

.eslintrc.json

{
  "env": {"es6": true},
  "plugins": ["promise"],
  "rules": {
    "promise/no-return-wrap": 2
  }
}

test.js

promise.then(() => Promise.resolve())
promise.then(() => Promise.reject())
  1. Run eslint test.js.

Expected behavior: The errors Avoid wrapping return values in Promise.resolve and Expected throw instead of Promise.reject.

Actual behavior: No errors.

Versions

  • Node version: 12.18.2
  • ESLint version: 7.3.1
  • eslint-plugin-promise version: 4.2.1