eslint-plugin-no-void-return-type

v1.0.2
A rule that prevents void return turns on unexported functions.
eslint eslintplugin

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 the extends 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"


npm i eslint-plugin-no-void-return-type

Metadata

  • GPL-3.0
  • Whatever
  • Zamiell
  • released 9/11/2021

Downloads

Maintainers