Detalhes do pacote

eslint-plugin-no-void-return-type

Zamiell8.3kGPL-3.01.0.2

A rule that prevents void return turns on unexported functions.

eslint, eslintplugin

readme (leia-me)

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"