# eslint-plugin-catch-call-function

> enforce call specified function or rethrow inside catch clause.

Latest version **0.1.0** (published 2021-08-02) · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-catch-call-function
pnpm add eslint-plugin-catch-call-function
yarn add eslint-plugin-catch-call-function
bun add eslint-plugin-catch-call-function
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-08-02 |
| First published | 2021-08-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yiminghe |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-catch-call-function
- npm.io page: https://npm.io/package/eslint-plugin-catch-call-function

## Dependencies (1)

- [esquery](https://npm.io/package/esquery.md) 1.x

## Recent versions

- 0.1.0 (latest) — 2021-08-02

## README

# eslint-plugin-catch-call-function

enforce call specified function or rethrow inside catch clause.

[![eslint-plugin-catch-call-function](https://nodei.co/npm/eslint-plugin-catch-call-function.png)](https://npmjs.org/package/eslint-plugin-catch-call-function)
[![NPM version](https://badge.fury.io/js/eslint-plugin-catch-call-function.png)](http://badge.fury.io/js/eslint-plugin-catch-call-function)
[![NPM downloads](http://img.shields.io/npm/dm/eslint-plugin-catch-call-function.svg)](https://npmjs.org/package/eslint-plugin-catch-call-function)
[![Build Status](https://travis-ci.org/yiminghe/eslint-plugin-catch-call-function.svg?branch=master)](https://travis-ci.org/yiminghe/eslint-plugin-catch-call-function)

## usage
.eslintrc.js

```js
module.exports = {
  plugins: ['eslint-plugin-catch-call-function'],
  rules:{
    // must call reportError function or re throw
    'catch-call-function/catch-call-function':['error', ['reportError','throw']],
  }
};
```


## rules

### catch-call-function/catch-call-function

在

#### Options

correct:

```js
/*eslint catch-call-function/catch-call-function: ["error", ["reportError","throw"]]*/

try {
  console.log(1);
} catch (e) {
  reportError(e);
  // throw e;
}
```

wrong:

```js
/*eslint catch-call-function/catch-call-function: ["error", ["reportError"]]*/

try {
  console.log(1);
} catch (e) {
  console.log(e);
}
```

```
  3:3  error  Must call function inside catch: reportError  catch-call-function/catch-call-function
```

---
_Source: https://npm.io/package/eslint-plugin-catch-call-function · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
