sandbox/npm/prettier-config
Yongmin Hong 5c16c87f8d
npm(prettier-config): add prettier plugins, add rules, consolidate
Summary:
And run `npm run p:w .` for that, and add .prettierignore so `sh` plugin ignores them.

Signed-off-by: Yongmin Hong <revi@omglol.email>

Test Plan: `npm run p:c .` and `npm publish`.

Reviewers: O1 revi & automations, revi

Reviewed By: O1 revi & automations, revi

Differential Revision: https://issuetracker.revi.xyz/D355
2024-06-18 18:46:30 +09:00
..
package.json npm(prettier-config): add prettier plugins, add rules, consolidate 2024-06-18 18:46:30 +09:00
prettier.config.js npm(prettier-config): add prettier plugins, add rules, consolidate 2024-06-18 18:46:30 +09:00
README.md npm(prettier-config): add prettier plugins, add rules, consolidate 2024-06-18 18:46:30 +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/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',
  ],
  overrides: [
    {
      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: ['.arcconfig', '.arclint', '.arcunit', '.imgbotconfig'],
      options: {parser: 'json'},
    },
    {
      files: ['.vscode/*.json', '**.hujson'],
      options: {parser: 'jsonc'},
    },
    {
      files: '.yamllint',
      options: {parser: 'yaml'},
    },
  ],
};

export default config;