Skip to content

Commit cb32d51

Browse files
committed
Remove the unneeded @babel/no-invalid-this eslint disable rule
It looks like this line was a false positive for @babel/no-invalid-this initially because here `this` comes from a parameter and it's not a global `this`. After we upgraded the eslint version, this is correctly caught and not reported as error. I double checked this rule, by specifically making this mistake in the codebase, and it looks like we catch it properly elsewhere, so it's not a case where we fail to detect this rule. This is the explanation of that rule: https://eslint.org/docs/latest/rules/no-invalid-this I explicitly tried the first incorrect example here and `yarn lint-js` catches it properly.
1 parent c57078e commit cb32d51

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/test/components/MenuButtons.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ describe('app/MenuButtons', function () {
437437
jest.spyOn(Date.prototype, 'toLocaleString').mockImplementation(function (
438438
this: Date
439439
) {
440-
// eslint-disable-next-line @babel/no-invalid-this
441440
return 'toLocaleString ' + this.toUTCString();
442441
});
443442

0 commit comments

Comments
 (0)