Skip to content

Commit

Permalink
feat: port no-this-assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
tunguyen-ct committed Sep 13, 2023
1 parent c5cba64 commit 53ee4e0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/eslint-plugin-chotot/src/rules/no-this-assignment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ export = defineRule({
messages,
},
create(context) {
context.on('VariableDeclarator', node => getProblem(node.id, node.init));
context.on('AssignmentExpression', node => getProblem(node.left, node.right));
return {
VariableDeclarator(node) {
const prob = getProblem(node.id, node.init);
if (prob) {
context.report(prob);
}
},
AssignmentExpression(node) {
const prob = getProblem(node.left, node.right);
if (prob) {
context.report(prob);
}
},
}
},
});

0 comments on commit 53ee4e0

Please sign in to comment.