eslint-plugin-no-void-return-type
v1.0.2
Published
A rule that prevents void return turns on unexported functions.
Downloads
18,919
Readme
eslint-plugin-no-void-return-type
What is this?
This is a rule that disallows void return types on unexported functions. For example:
const myMap = new Map();
// Bad
function foo(): void {}
// Good
function foo() {}
This is useful in combination with the recommended explicit-module-boundary-types rule, because when you convert an exported function to an unexported function, you often forget to remove the superfluous return type annotation.
How do I use it?
npm install --save-dev eslint-plugin-no-void-return-type
- Add
"plugin:no-void-return-type/recommended"
to theextends
section of your.eslintrc.js
file.
What rules does this plugin provide?
It only provides one rule: "no-void-return-type/no-void-return-type"