App: [HOLD for payment 2023-05-05] [$1000] Enable `no-invalid-this` ESLint rule

Context: https://expensify.slack.com/archives/C049HHMV9SM/p1682089468352009

Problem

Using this outside of classes or class-like objects might work because it could refer to the module (for example, ReportUtils), but after building it, it might not be the case. This will cause crashes that cannot be caught while testing PRs and will only be seen once the app is deployed on staging or production.

Solution

Enable this ESLint rule (no-invalid-this) in our eslint-config-expensify repo.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0138e39a2b0f958b39
  • Upwork Job ID: 1650895714648719360
  • Last Price Increase: 2023-04-25

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 28 (15 by maintainers)

Most upvoted comments

@s77rt paid! Thank you!

@NicMendonca Applied.

@Prince-Mendiratta you’ve been paid, thank you!

  • The PR that introduced the bug has been identified: Not a bug, this is a feature request.
  • The offending PR has been commented on: n/a
  • A discussion in #expensify-bugs has been started: n/a
  • Determine if we should create a regression test for this bug: n/a

What a friendly non time-consuming checklist 😍

PR enabling the rule is ready.

PR bumping the version on E/A is ready for review as well but awaiting merge on the aforementioned PR.

Applied in Upwork.

cc @tgolen @s77rt @NicMendonca

Assigning @Prince-Mendiratta since I think @tgolen forgot hehe

@alitoshmatov Thanks for the proposal. Given this is a feature request there is not much to base proposal selection on. So we are going with the first proposal that we get. I hope this makes sense and looks fair for all. The location of the rule is not a significant difference and I think es6 is just fine.

@Prince-Mendiratta Thanks for the proposal. Let’s get this going!

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

cc @pecanoro