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

Error if calling a string/template/number literal

Open strager opened this issue 3 years ago • 20 comments

let randomVar = 5();

5 is called as if it was a function. We should report an error for trivial cases like this.

In the future, we might want to provide a nice diagnostic suggesting inserting a semicolon in cases like the following (suggested by elliot416):

let randomVar = 5 // <-- no semicolon
 
(function() {
 
});

strager avatar Jan 06 '22 01:01 strager

Hi! I am in an intro to swe class that is requiring me to work on my first open-source project. I was wondering if this issue is still open and if so could I get help with my first contribution?

Ishvina avatar Jan 20 '22 16:01 Ishvina

Yes, this task is still open.

I can definitely help you with this task if you have problems. I can answer questions here or weekdays on my Twitch stream (https://twitch.tv/strager). (However, I'm on a vacation right now, so my availability is spotty until January 26.)

cc @singalhimanshu who can help if I'm not around.

strager avatar Jan 20 '22 19:01 strager

Ok perfect thank you so much!

Ishvina avatar Jan 20 '22 20:01 Ishvina

@Ishvina let me know if you are facing any issues.

singalhimanshu avatar Jan 21 '22 05:01 singalhimanshu

@singalhimanshu Hi! Thank you. Can you tell me where to begin and where I should find these errors?

Ishvina avatar Jan 21 '22 17:01 Ishvina

@singalhimanshu Hi! Thank you. Can you tell me where to begin and where I should find these errors?

Have you done the project setup? Are you able to run quick-lint-js on js files? If not follow the instructions here - https://github.com/quick-lint/quick-lint-js/blob/master/docs/BUILDING.md

singalhimanshu avatar Jan 21 '22 18:01 singalhimanshu

Can you tell me where to begin and where I should find these errors?

I usually start by reproducing the problem. In this case, the problem is that quick-lint-js reports no error, but Node.js does report an error (when the code runs). I'd reproduce by creating a .js file and running quick-lint-js and Node.js on the .js file. (You need to build quick-lint-js from source by following the instructions @singalhimanshu linked.)

Then, I'd write a test case. I'd probably write a test in test/test-parse-expression.cpp. In order to write the test, we need a new error type, which we'd add in src/quick-lint-js/fe/diagnostic-types.h.

strager avatar Jan 21 '22 23:01 strager

Hi! I am taking an intro class that requires me to work on my first open-source project. I noticed that this issue was assigned two months ago but has not been resolved. If this issue is still open, could I be assigned it?

mketer1 avatar Mar 22 '22 07:03 mketer1

@Ishvina Are you still working on this task?

strager avatar Mar 22 '22 07:03 strager

If @Ishvina does not respond, would I be able to receive assignment for this task. Also, because I'm still new to open source contribution, would it be possible to get guidance/assistance if need be?

mketer1 avatar Mar 22 '22 08:03 mketer1

If @Ishvina does not respond, would I be able to receive assignment for this task.

Yes.

[...] would it be possible to get guidance/assistance if need be?

Yes, of course.

strager avatar Mar 22 '22 09:03 strager

@mketer1 Do you still want to work on this task?

strager avatar May 27 '22 09:05 strager

Hey @strager can I work on this task?

fk00750 avatar Aug 01 '22 20:08 fk00750

@fk00750 You may.

strager avatar Aug 01 '22 21:08 strager

@fk00750 Are you still working on this task? Do you need any help?

strager avatar Sep 25 '22 05:09 strager

Hello! Has this been resolved yet? If not I'm also interested in trying to solve this

catmar22 avatar Nov 10 '22 05:11 catmar22

@catmar22 I think @fk00750 abandoned the task. You can take it over.

strager avatar Nov 10 '22 07:11 strager