How to disable WebStorm semicolon check?

2020-02-02 06:07发布

How to disable WebStorm semicolon check in Node.js?

I have tried the following method but they do not work:

  • Checked out the option use semicolon to terminate statement
  • Changed JavaScript version to ecma6

5条回答
Summer. ? 凉城
2楼-- · 2020-02-02 06:47

Using Webstorm->Preferences->Editor->Code Style->JavaScript Use semicolon to terminate spaces works fine for me. Maybe double check what Code Style scheme you are setting that for. Sometimes I have changed code style settings, but for a different scheme than the one being applied to the project in question.

enter image description here

查看更多
霸刀☆藐视天下
3楼-- · 2020-02-02 06:56

Cmd(Ctrl) + Shift + A → Unterminated statement → OFF

enter image description here

查看更多
乱世女痞
4楼-- · 2020-02-02 06:57
  1. Settings/Preferences | Editor | Inspections
  2. JavaScript | Code style issues | Unterminated statement -- disable this inspection

You can also reach the same inspection by:

  1. Placing caret on problematic place in your Editor and bringing Quick Fix menu (Alt + Enter or by clicking on light bulb icon)
  2. Choosing right option in appeared menu (if not sure which one then try step #3 for few of them)
  3. Arrow Right (or click on small triangle on the right side) to open submenu
  4. Choose desired action

P.S. JSLinh/JSHint and alike may also produce such warnings if you are using these tools.


As for the actual code generated by IDE (e.g. when using Code | Reformat... or using code completion popup/functionality) -- such option is available at

  • Settings/Preferences | Editor | Code Style | JavaScript (similar path for TypeScript)
  • Punctuation tab

enter image description here

查看更多
Ridiculous、
5楼-- · 2020-02-02 06:59

In Preferences -> Editor -> Code Style -> JavaScript, click the Punctuation tab on the right hand side pane.

Set

Don't use semicolon to terminate statements always

This would allow you to check for unterminated statements while not flagging up the missing semicolons.

查看更多
成全新的幸福
6楼-- · 2020-02-02 07:00

In Webstorm 2017 its here, you just need to change "use" to "don't use" instead.

Webstorm 2017

查看更多
登录 后发表回答