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

Bug: Doesn't work "overrides" property for vue #39

Open
doox911 opened this issue Dec 2, 2022 · 2 comments
Open

Bug: Doesn't work "overrides" property for vue #39

doox911 opened this issue Dec 2, 2022 · 2 comments

Comments

@doox911
Copy link

doox911 commented Dec 2, 2022

I have the config:

{
  "typescript": {
    "quoteStyle": "preferSingle"
  },
  "json": {},
  "markdown": {},
  "toml": {},
  "dockerfile": {},
  "includes": [
    "**/*.{vue, ts,tsx,js,jsx,cjs,mjs,json,md,toml,dockerfile}"
  ],
  "prettier": {
    "printWidth": 100,
    "singleQuote": true,
    "trailingComma": "all",
    "overrides": [
      {
        "files": "*.vue",
        "options": {
          "vueIndentScriptAndStyle": true
        }
      }
    ]
  },
  "excludes": [
    "**/node_modules",
    "**/*-lock.json",
    "./dist"
  ],
  "plugins": [
    "https://plugins.dprint.dev/typescript-0.74.0.wasm",
    "https://plugins.dprint.dev/json-0.15.6.wasm",
    "https://plugins.dprint.dev/markdown-0.14.1.wasm",
    "https://plugins.dprint.dev/toml-0.5.4.wasm",
    "https://plugins.dprint.dev/dockerfile-0.3.0.wasm",
    "https://plugins.dprint.dev/prettier-0.15.0.json@ff80be22d9d596d17a1ca0767e2cbdddd518cf7d23773045ab90d12dfc63f5d5"
  ]
}

I have the component:

<template>
  <div />
</template>

<script setup lang="ts">
  import { computed } from 'vue';
</script>

I expect that after formatting, the indentation of the script section will be preserved, but it disappears:

<template>
  <div />
</template>

<script setup lang="ts">
import { computed } from 'vue';
</script>

That is, the overrides property is ignored.

@davidbludlow
Copy link

davidbludlow commented Mar 30, 2023

I also ran into this issue, when trying to override some settings for some json files. Maybe the name of this issue should be changed to not just be specific to vue files?

@MaxWinterstein
Copy link

same thing for me here, would love to integrate prettier into dprint, but sadly wildcard overrides are not possible:

  "prettier": {
    "overrides": [
      {
        "files": ["**/snapshots/*.json"],
        "options": { "printWidth": 160 }
      }
    ]
  },

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

No branches or pull requests

3 participants