简体   繁体   中英

How to customize semicolon help for TypeScript in IntelliJ IDEA

I would like to know if it's possible to customize the way IntelliJ highlights the line endings in TypeScript files where a semicolon is 'missing'. It appears to highlight that space everywhere where the next line is another statement. From what I understand, as long as the next statement does not start with [ or (, and our team does not put newlines in stupid places like directly after return, continue etc, there is no pain.

I'm talking about the highlight that looks like 这个 .

There are two ways to control this.

  • Put the cursor on the place where Intellij highlights the missing semicolon. Click the "lightbulb" icon that should then pop up (or Alt-Enter keyboard shortcut for me), you'll see "Terminate statement". Click the right arrow on keyboard which will open that menu item, click on "Disable inspection"

  • Open Intellij Preferences. Search for "unterminated statement". You'll find it under Editor->Inspections -> Javascript->Code style issues->Unterminated statement. Uncheck its checkbox.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM