enforce call specified function or rethrow inside catch clause.
npm install eslint-plugin-catch-call-functionenforce call specified function or rethrow inside catch clause.




``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']],
}
};
在
#### 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