Vetur: css,<style> or <style scoped> don't work

Created on 28 Nov 2018  ·  10Comments  ·  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Win10
  • Vetur version: 0.14.2
  • VS Code version: 1.29.1

Problem

hello , I have a question about format css
I have 0.14.2 and set,but it don't work css

Reproducible Case

this is my vscode setting

  "vetur.format.options.tabSize": 2,
  "vetur.format.options.useTabs": false,
  "vetur.format.defaultFormatter.html": "prettyhtml",
  "vetur.validation.template": false,
  "vetur.format.defaultFormatter.js": "prettier",
  "vetur.format.defaultFormatter.css": "prettier",
  "vetur.format.defaultFormatterOptions": {
    "prettyhtml": {
      "printWidth": 10000,
      "singleQuote": false,
      "wrapAttributes": false,
      "sortAttributes": true
    },
    "prettier": {
      "printWidth": 120,
      "tabWidth": 2,
      "useTabs": false,
      "semi": true,
      "singleQuote": true,
      "trailingComma": "all",
      "bracketSpacing": true,
      "jsxBracketSameLine": true,
      "arrowParens": "always",
      "endOfLine": "crlf"
    }
  }

if

"vetur.format.defaultFormatterOptions": {
    "prettier": {
      "parser": "css"
    }
  }

then css work , js

All 10 comments

+1 osx also has the same case

Please fork https://github.com/octref/veturpack to reproduce this issue.

I have this exact setting and it works.

If add parse:"css" all worked, otherwise none of style formatted.

@octref please delete the .prettierrc in the root directory, it still work or not?

@octref ,this person @illuSioN4ng say right,if delete .prettierrc ,it don't work,the formatted because the .prettierrc, no vscode setting

不好使,肯定有bug!

@illuSioN4ng

Thanks for the repro. Now I can fix it.

Try 0.14.3.

@octref the new version it works well

Thanks @octref @illuSioN4ng

Was this page helpful?
0 / 5 - 0 ratings