# eslint-plugin-alidocs

> ``` wget --no-check-certificate -O- https://pds.alibaba-inc.com/chengyu/tnvm/install.sh | bash source $HOME/.tnvm/tnvm.sh tnvm install node-v12.16.3 nvm install 10 npm install --registry=https://registry.npm.alibaba-inc.com -g yarn @ali/yarn tnpm ayarn ad

Latest version **0.0.4** (published 2021-08-10) · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-alidocs
pnpm add eslint-plugin-alidocs
yarn add eslint-plugin-alidocs
bun add eslint-plugin-alidocs
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-08-10 |
| First published | 2020-05-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yiminghe |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-alidocs
- npm.io page: https://npm.io/package/eslint-plugin-alidocs

## Dependencies (1)

- [eslint-plugin-catch-call-function](https://npm.io/package/eslint-plugin-catch-call-function.md) 0.1.x

## Recent versions

- 0.0.4 (latest) — 2021-08-10
- 0.0.3 — 2020-07-29
- 0.0.2 — 2020-05-21
- 0.0.1 — 2020-05-21

## README

## eslint-plugin-alidocs

```
wget --no-check-certificate -O- https://pds.alibaba-inc.com/chengyu/tnvm/install.sh | bash
source $HOME/.tnvm/tnvm.sh
tnvm install node-v12.16.3
nvm install 10
npm install --registry=https://registry.npm.alibaba-inc.com -g yarn @ali/yarn tnpm
ayarn add eslint-plugin-alidocs
```

.eslintrc.js
```js
module.exports = {
  plugins: ['alidocs'],
  rules:{
    // catch 里面必须调用 reportError 函数 或者重新 throw
    'alidocs/catch-call-function':['error', ['reportError','throw']],
  }
};
```


## rules

### alidocs/catch-call-function

在

#### Options

只有个字符串数组选项，表示必须调用的函数名，throw 表示 rethrow

正确例子

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

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

错误

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

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

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

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