2024-06-14 12:41:11 +02:00
|
|
|
# @revi/prettier-config
|
|
|
|
|
2024-06-17 05:42:34 +02:00
|
|
|
[![NPM Version](https://img.shields.io/npm/v/%40revi%2Fprettier-config?logo=npm&cacheSeconds=600)](https://www.npmjs.com/package/@revi/prettier-config)
|
|
|
|
[![GitHub License](https://img.shields.io/github/license/revi/sandbox?logo=apache&cacheSeconds=600)](https://github.com/revi/sandbox/tree/master/npm/prettier-config)
|
|
|
|
|
2024-06-14 12:41:11 +02:00
|
|
|
This is [@revi](https://revi.xyz/)'s personal [prettier](https://prettier.io/docs/en/) config.
|
|
|
|
|
|
|
|
## Config
|
|
|
|
|
|
|
|
```js
|
|
|
|
const config = {
|
|
|
|
bracketSpacing: false,
|
|
|
|
bracketSameLine: true,
|
|
|
|
proseWrap: 'preserve',
|
|
|
|
singleQuote: true,
|
|
|
|
trailingComma: 'all',
|
2024-06-18 11:42:33 +02:00
|
|
|
plugins: [
|
2024-10-08 10:41:38 +02:00
|
|
|
// https://github.com/matzkoh/prettier-plugin-packagejson
|
|
|
|
'prettier-plugin-packagejson',
|
2024-06-18 11:42:33 +02:00
|
|
|
// 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',
|
2024-07-01 07:27:37 +02:00
|
|
|
// https://github.com/prettier/plugin-xml
|
|
|
|
'@prettier/plugin-xml',
|
2024-06-18 11:42:33 +02:00
|
|
|
],
|
2024-06-14 12:41:11 +02:00
|
|
|
overrides: [
|
2024-06-30 09:41:50 +02:00
|
|
|
// Sort by parser alphabet.
|
2024-06-14 12:41:11 +02:00
|
|
|
{
|
2024-06-18 11:42:33 +02:00
|
|
|
files: ['.arcconfig', '.arclint', '.arcunit', '.imgbotconfig'],
|
2024-06-14 12:41:11 +02:00
|
|
|
options: {parser: 'json'},
|
|
|
|
},
|
|
|
|
{
|
2024-06-20 07:29:13 +02:00
|
|
|
files: [
|
2024-07-03 22:50:13 +02:00
|
|
|
'**/*.hujson',
|
2024-06-22 10:31:25 +02:00
|
|
|
'.devcontainer.json',
|
2024-07-03 22:50:13 +02:00
|
|
|
'.devcontainer/**/devcontainer.json',
|
2024-10-08 10:41:38 +02:00
|
|
|
'**/dprint.json',
|
2024-07-03 22:50:13 +02:00
|
|
|
'.vscode/**/*.json',
|
2024-06-25 09:06:14 +02:00
|
|
|
'**/jsconfig.json',
|
|
|
|
'**/jsconfig.*.json',
|
|
|
|
'**/tsconfig.json',
|
|
|
|
'**/tsconfig.*.json',
|
2024-06-20 07:29:13 +02:00
|
|
|
],
|
2024-06-19 07:31:06 +02:00
|
|
|
options: {parser: 'jsonc', trailingComma: 'none'},
|
2024-06-14 12:41:11 +02:00
|
|
|
},
|
2024-06-30 09:41:50 +02:00
|
|
|
{
|
|
|
|
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},
|
|
|
|
},
|
2024-07-01 07:27:37 +02:00
|
|
|
{
|
|
|
|
files: ['*.svg', '*.xml'],
|
|
|
|
options: {
|
|
|
|
parser: 'xml',
|
|
|
|
singleAttributePerLine: false,
|
|
|
|
xmlQuoteAttributes: 'preserve',
|
|
|
|
xmlSelfClosingSpace: true,
|
|
|
|
xmlSortAttributesByKey: false,
|
|
|
|
xmlWhitespaceSensitivity: 'strict',
|
|
|
|
},
|
|
|
|
},
|
2024-06-14 12:41:11 +02:00
|
|
|
{
|
|
|
|
files: '.yamllint',
|
|
|
|
options: {parser: 'yaml'},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
2024-06-18 11:42:33 +02:00
|
|
|
|
|
|
|
export default config;
|
2024-06-14 12:41:11 +02:00
|
|
|
```
|