项目作者: hayawata3626

项目描述 :
ESLint plugin that checks if the arrow function can remove the brace.
高级语言: TypeScript
项目地址: git://github.com/hayawata3626/eslint-plugin-arrow-function-brace.git


eslint-plugin-arrow-function-brace

ESLint plugin that checks if the arrow function can remove the brace.

Installation

  1. npm install --save-dev eslint-plugin-arrow-function-brace

Setup

Touch .eslintrc

  1. {
  2. "plugins": [
  3. ...,
  4. "arrow-function-brace"
  5. ],
  6. "rules": {
  7. ...,
  8. "arrow-function-brace/arrow-function-brace": 1
  9. }
  10. }

Example

Show a warning message if the arrow function can remove the brace.

  1. const isAdult = (age) => {
  2. return age >= 20;
  3. };
  1. example-prj/index.ts
  2. 1:1 warning can remove the brace from the arrow function.
  3. 1 problem (0 errors, 1 warning)

Lisence

MIT