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

8$: Extra character `,` on end of useState() gives mediocre error message.

Open LeeWannacott opened this issue 2 years ago • 5 comments

Doesn't tell me to remove extra character , on the end.

image

This should give an error saying unexpected token and missing semicolon like below: image

LeeWannacott avatar Feb 10 '22 08:02 LeeWannacott

I think we can implement this using the following logic: if const is after , when parsing variable bindings (parser::parse_and_visit_let_bindings in parse-statement-inl.h), reporting a different error than E0024 (error_let_with_no_bindings). I think E0036 is similar.

strager avatar Apr 15 '22 10:04 strager

I would like to give this issue a shot.

I claim this for-hire task. I expect payment after I complete this task. I will email the quick-lint-js team if I am assigned this task.

ghost avatar May 06 '22 01:05 ghost

I think we can implement this using the following logic: if const is after , when parsing variable bindings (parser::parse_and_visit_let_bindings in parse-statement-inl.h), reporting a different error than E0024 (error_let_with_no_bindings). I think E0036 is similar.

Hi, is this task closed or still available??? Thanks

Moshahrani avatar Jul 25 '22 20:07 Moshahrani

@Moshahrani You can work on it if you want.

strager avatar Jul 26 '22 06:07 strager

@Moshahrani You can work on it if you want.

Thanks!

Moshahrani avatar Aug 02 '22 04:08 Moshahrani

@Moshahrani Did you make progress? Do you need any help?

strager avatar Sep 25 '22 05:09 strager

I claim this for-hire task. I expect payment after I complete this task. I will email the quick-lint-js team if I am assigned this task.

matttheus avatar Apr 13 '23 02:04 matttheus

I'm still working on this issue

matttheus avatar May 10 '23 13:05 matttheus

Hey @strager I was not able to make progress on this issue, I will give up for now

matttheus avatar May 24 '23 21:05 matttheus

Is this issue still opened by mistake?

I tried to simulate the bug in the QLJS playground:

image

HicaroD avatar Aug 08 '23 22:08 HicaroD

The bug is still present. Here's a repro:

function useState() {}

const [a, setA] = useState(),
const [b, setB] = useState();

strager avatar Aug 10 '23 22:08 strager