quick-lint-js icon indicating copy to clipboard operation
quick-lint-js copied to clipboard

7$: warn on 'x == a || null' and 'x == a || undefined'

Open strager opened this issue 2 years ago • 3 comments

strager avatar Sep 09 '22 04:09 strager

I think we can tweak our existing logic for E0190.

strager avatar Sep 09 '22 04:09 strager

For this task, you can look at the logic for either:

  • E0286/E0287 (parser::error_on_pointless_string_compare in src/quick-lint-js/fe/parse.cpp), introduced in commit 35207e6616267c6c81be63f47ce97ec2452d60df, or
  • E0190 (parser::error_on_sketchy_condition in src/quick-lint-js/fe/parse.cpp), introduced in 1634b9808e0785ca75dbf4fb545a40ee403ebc51.

The logic and testing for this lint should be similar to the above lints.

Tests would go in test/test-parse-warning.cpp.

strager avatar Sep 14 '22 18:09 strager

I can work on this issue

rohitsasi720 avatar Sep 14 '22 18:09 rohitsasi720

@rohitsasi720 Do you need any help?

strager avatar Sep 24 '22 07:09 strager

@strager , Can I take up this issue?

HarshitAghera avatar Nov 25 '22 15:11 HarshitAghera

@HarshitAghera I suggest finishing issue #852 first before working on this issue.

@rohitsasi720 Have you made progress on this task?

strager avatar Dec 01 '22 01:12 strager

@strager, can I start working on this?

HarshitAghera avatar Jan 12 '23 06:01 HarshitAghera

@HarshitAghera Yes you may!

strager avatar Jan 12 '23 09:01 strager