sandbox/npm/prettier-config
renovate[bot] f69d4b1a13
CI(deps): Update npm patch upgrades
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 01:32:41 +00:00
..
types npm(prettier-config): add xml, alphabetical sort 2024-06-30 16:56:39 +09:00
CHANGELOG.md npm(prettier-config): Bump version to v0.2.2 2024-10-15 17:27:27 +09:00
package.json CI(deps): Update npm patch upgrades 2024-10-17 01:32:41 +00:00
prettier.config.js npm/prettier-config: Bump version to v0.2.1 2024-10-08 17:43:13 +09:00
README.md npm/prettier-config: Bump version to v0.2.1 2024-10-08 17:43:13 +09:00

@revi/prettier-config

NPM Version GitHub License

This is @revi's personal prettier config.

Config

const config = {
  bracketSpacing: false,
  bracketSameLine: true,
  proseWrap: 'preserve',
  singleQuote: true,
  trailingComma: 'all',
  plugins: [
    // https://github.com/matzkoh/prettier-plugin-packagejson
    'prettier-plugin-packagejson',
    // https://github.com/prettier/plugin-php
    '@prettier/plugin-php',
    // https://github.com/un-ts/prettier/tree/master/packages/sh
    'prettier-plugin-sh',
    // https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml
    'prettier-plugin-toml',
    // https://github.com/prettier/plugin-xml
    '@prettier/plugin-xml',
  ],
  overrides: [
    // Sort by parser alphabet.
    {
      files: ['.arcconfig', '.arclint', '.arcunit', '.imgbotconfig'],
      options: {parser: 'json'},
    },
    {
      files: [
        '**/*.hujson',
        '.devcontainer.json',
        '.devcontainer/**/devcontainer.json',
        '**/dprint.json',
        '.vscode/**/*.json',
        '**/jsconfig.json',
        '**/jsconfig.*.json',
        '**/tsconfig.json',
        '**/tsconfig.*.json',
      ],
      options: {parser: 'jsonc', trailingComma: 'none'},
    },
    {
      files: '*.php',
      options: {
        parser: 'php',
        phpVersion: '8.1',
        useTabs: true,
        tabWidth: 4,
        braceStyle: '1tbs',
      },
    },
    {
      files: [
        '.editorconfig',
        '.gitattributes',
        '.gitignore',
        '.prettierignore',
      ],
      options: {parser: 'sh', keepPadding: true, minify: false},
    },
    {
      files: ['*.svg', '*.xml'],
      options: {
        parser: 'xml',
        singleAttributePerLine: false,
        xmlQuoteAttributes: 'preserve',
        xmlSelfClosingSpace: true,
        xmlSortAttributesByKey: false,
        xmlWhitespaceSensitivity: 'strict',
      },
    },
    {
      files: '.yamllint',
      options: {parser: 'yaml'},
    },
  ],
};

export default config;