Tafseen Rahman
Tafseen Rahman

Reputation: 47

Prevent auto semicolon in Visual Studio Code

I'm using the Visual Studio Code. I never want auto semicolon after CSS properties. But VS Code gives me an auto-complete option which I don't like.

How can I stop auto-complete semicolon at the end of CSS properties?

Upvotes: 5

Views: 6017

Answers (4)

Hardik Patel
Hardik Patel

Reputation: 3949

Adding .prettierrc file in project root worked for me with following settings:

{
     "files": [
              "**/*.css"
              ],
     "options": {
                "semi": false,
                "parser": "css"
                }
}

Upvotes: 0

Ashok Chapagai
Ashok Chapagai

Reputation: 111

  1. Press Control + Shift + P in VSCode.

  2. Search For Preferences: Open Settings (UI).

  3. Again in the Searchbar, search for Semicolon.

  4. Choose CSS or your preferred language from where you want to remove auto semicolon.

  5. Untick Insert semicolon at the end of line when completing CSS properties.

And you are done.

Upvotes: 6

Earid
Earid

Reputation: 842

  1. Settings > Extensions > CSS , uncheck the Complete Property With Semicolon.

or

  1. You can change the default values in the Settings editor.

search the code & change it from true to false.

// Insert semicolon at end of line when completing CSS properties
  "scss.completion.completePropertyWithSemicolon": false,

From: https://code.visualstudio.com/docs/getstarted/settings

Upvotes: 8

thedevlpr
thedevlpr

Reputation: 1101

In Settings go to Extensions -> CSS and uncheck 'Completion: Complete Property With Semicolon'

Upvotes: 2

Related Questions