docs: {
description: "Disallow `catch` clause parameters from shadowing variables in the outer scope",
recommended: false,
- url: "https://eslint.org/docs/rules/no-catch-shadow"
+ url: "https://eslint.org/docs/latest/rules/no-catch-shadow"
},
replacedBy: ["no-shadow"],
create(context) {
+ const sourceCode = context.sourceCode;
+
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
return {
"CatchClause[param!=null]"(node) {
- let scope = context.getScope();
+ let scope = sourceCode.getScope(node);
/*
* When ecmaVersion >= 6, CatchClause creates its own scope