Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to configure the HTML/JS/CSS sections of a .vue file differently? #2493

Open
4 tasks done
fenomas opened this issue Nov 21, 2020 · 1 comment
Open
4 tasks done

Comments

@fenomas
Copy link

fenomas commented Nov 21, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: 0.30.2
  • VS Code version: 1.51.1

Problem

The use case here is when you want (for example) smaller tab widths in HTML than in CSS/JS. In prettier, apparently the only way to do this is by specifying overrides according to file type, but this doesn't work when done in vetur's prettier config.

Is there any way of achieving this?

Reproducible Case

Below is a sample /.vscode/settings.json, that tries to set tabWidth to 4 generally, but to 2 for HTML files. When used with vetur, the overrides appear to be ignored (even if one specifies *.vue, though of course that wouldn't be particularly useful here).

{
    "vetur.format.defaultFormatterOptions": {
        "prettier": {
            "tabWidth": 4,
            "overrides": [
                {
                    "files": "*.html",
                    "options": {
                        "tabWidth": 2
                    }
                },
            ]
        },
    }
}
@yoyo930021
Copy link
Member

yoyo930021 commented Nov 25, 2020

It's not work now, but It's possible to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants