chore(eslint): ensure proper error handling
This commit is contained in:
parent
fb7e42cef3
commit
3a8465a422
|
|
@ -113,6 +113,14 @@ export default [
|
|||
selector: 'CallExpression[callee.property.name="catch"] > ArrowFunctionExpression[params.length<=1][body.value=null]',
|
||||
message: 'Usage of .catch(() => null) is not allowed. Please handle the error appropriately.',
|
||||
},
|
||||
{
|
||||
selector: 'CallExpression[callee.property.name="catch"] > ArrowFunctionExpression[params.length<=1][body.name=undefined]',
|
||||
message: 'Usage of .catch(() => undefined) is not allowed. Please handle the error appropriately.',
|
||||
},
|
||||
{
|
||||
selector: 'CallExpression[callee.property.name="catch"] > ArrowFunctionExpression[params.length<=1] > ArrayExpression[elements.length<=1]',
|
||||
message: "Usage of .catch(() => []]) is not allowed. Please handle the error appropriately."
|
||||
}
|
||||
],
|
||||
|
||||
'no-unneeded-ternary': 'error',
|
||||
|
|
|
|||
Loading…
Reference in New Issue