summaryrefslogtreecommitdiff
path: root/.prettierrc.js
blob: d43df33f5b7a2d7ea91e1ac09c5f6d2d255e88f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Heads up: This file should be renamed to `.cjs`, however if we did that, changesets wouldn't be able to load it
module.exports = {
  printWidth: 100,
  semi: true,
  singleQuote: true,
  tabWidth: 2,
  trailingComma: 'es5',
  useTabs: true,
  plugins: ['./node_modules/prettier-plugin-astro'],
  overrides: [
    {
      // Changesets run Prettier using our configuration, however it uses a very old version of Prettier that does
      // not support our plugin and it ends up doing more harm than good. As such, we'll disable our plugin for changelogs
      files: ['CHANGELOG.md'],
      options: {
        plugins: [],
      },
    },
    {
      files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
      options: {
        useTabs: false,
      },
    },
    {
      files: ['**/*.astro'],
      options: {
        parser: 'astro',
      },
    },
  ],
};