quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.52k stars 191 forks source link

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

Open LeeWannacott opened 2 years ago

LeeWannacott commented 2 years ago

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

strager commented 2 years ago

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.

ghost commented 2 years ago

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.

Moshahrani commented 2 years ago

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

strager commented 2 years ago

@Moshahrani You can work on it if you want.

Moshahrani commented 1 year ago

@Moshahrani You can work on it if you want.

Thanks!

strager commented 1 year ago

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

matttheus commented 1 year ago

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 commented 1 year ago

I'm still working on this issue

matttheus commented 1 year ago

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

HicaroD commented 11 months ago

Is this issue still opened by mistake?

I tried to simulate the bug in the QLJS playground:

image

strager commented 11 months ago

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

function useState() {}

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