Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Determine void rules #290

Open
DHedgecock opened this issue Feb 7, 2021 · 0 comments
Open

Chore: Determine void rules #290

DHedgecock opened this issue Feb 7, 2021 · 0 comments

Comments

@DHedgecock
Copy link
Member

Determine what rules should be set for working with types and the void operator

Details

Currently in a React component this is an error:

onClick={(evt) => evt.stopPropagation()}
// ^ Void expressions returned from an arrow function shorthand must be marked explicitly with the `void` 
// operator.eslint@typescript-eslint/no-confusing-void-expression

This could be fixed with the void operator:

onClick={(evt) => void evt.stopPropagation()}

But currently the no-void ESLint rule is enabled making that an error.

  1. Disable no-void in TypeScript files?
  2. Add ignoreArrowShorthand: true to @typescript-eslint/no-confusing-void-expression?
  3. Do neither and include curly braces?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant