docs: {
description: "Disallow reassigning `const` variables",
recommended: true,
- url: "https://eslint.org/docs/rules/no-const-assign"
+ url: "https://eslint.org/docs/latest/rules/no-const-assign"
},
schema: [],
create(context) {
+ const sourceCode = context.sourceCode;
+
/**
* Finds and reports references that are non initializer and writable.
* @param {Variable} variable A variable to check.
return {
VariableDeclaration(node) {
if (node.kind === "const") {
- context.getDeclaredVariables(node).forEach(checkVariable);
+ sourceCode.getDeclaredVariables(node).forEach(checkVariable);
}
}
};