2 * @fileoverview Reports useless `catch` clauses that just rethrow their error.
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
17 description: "disallow unnecessary `catch` clauses",
18 category: "Best Practices",
20 url: "https://eslint.org/docs/rules/no-useless-catch"
31 node.param.type === "Identifier" &&
32 node.body.body.length &&
33 node.body.body[0].type === "ThrowStatement" &&
34 node.body.body[0].argument.type === "Identifier" &&
35 node.body.body[0].argument.name === node.param.name
37 if (node.parent.finalizer) {
40 message: "Unnecessary catch clause."
45 message: "Unnecessary try/catch wrapper."