Complaining about missing semicolon when I don't want it!
Answered
Hi,
I'm programming in JavaScript and I prefer not to use semicolons at the end of statements. I've switched off the "Use semicolon to terminate statements" option, but it still complains that a semicolon is missing at EVERY STATEMENT. It's getting a bit annoying. How do I make it stop complaining?
Please sign in to leave a comment.
Hi Tor-Ivar Valåmo,
Settings | Inspections | JavaScript | Code style issues | Unterminated statement
Thanks! That fixed it.
Also for other similar problems try pressing Alt+Enter on highlighted code. Context menu will be shown with suggested solutions, including disabling the inspection.
Still broken with typescript, even though the tslint.json says "never" for semicolons. WebStorm is increasingly unreliable.
Please can you elaborate on this? what errors do you see?
How to prevent IntelliJ from adding semicolons?
I have simple TypeScript class (file name is: Test.ts):
I have turned off warnings (Settings | Inspections | JavaScript | Code style issues | Unterminated statement) but it doesn't help because semicolon appears.
I'm formatting the code: ctrl + alt + l
And semicolon appears! I want to disable that because of TSLint rules. Is it possible?
@Rutenisturcinas
"Settings/Preferences | Editor | Code Style | TypeScript --> Punctuation tab" -- it has settings for quotes, semicolon and other stuff when generating/formatting the code.
Yes, it is what I was looking for. Thank you for help!
For some reason when I format code it removes all the semicolons. I want to have semicolons.
@Marcus J Whelan
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206369589/comments/115000605144
The full way for JavaScript is:
File | Settings | Editor | Inspections | JavaScript | Code style issues | Unterminated statement (must be disabled)
for Typescript:
File | Settings | Editor | Code Style | TypeScript > Punctuation tab > chose "Don't use semicolon to terminate statement"
I can't see to turn off this warning. I've done/turn off all settings. Still eslint complaining there's no semi-colon. Why O why is this so hard?
If the error comes from ESLint (if it has ESLint prefix) then you should edit ESLint configuration. Changing just IDE code style settings wouldn't affect ESLint.