2024-06-14 10:03:06 +02:00
|
|
|
// @ts-check
|
|
|
|
/**
|
|
|
|
* @file revi's prettier config preset
|
|
|
|
* @see https://prettier.io/docs/en/configuration.html
|
|
|
|
* @type {import("prettier").Config}
|
|
|
|
* @copyright Hong Yongmin 2024
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2024-06-14 12:41:11 +02:00
|
|
|
// Update README.md when you update the config.
|
2024-06-14 10:03:06 +02:00
|
|
|
const config = {
|
|
|
|
bracketSpacing: false,
|
|
|
|
bracketSameLine: true,
|
|
|
|
proseWrap: 'preserve',
|
|
|
|
singleQuote: true,
|
|
|
|
trailingComma: 'all',
|
2024-06-18 11:42:33 +02:00
|
|
|
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',
|
|
|
|
],
|
2024-06-14 10:03:06 +02:00
|
|
|
overrides: [
|
|
|
|
{
|
2024-06-18 11:42:33 +02:00
|
|
|
files: '*.php',
|
|
|
|
options: {
|
|
|
|
parser: 'php',
|
|
|
|
phpVersion: '8.1',
|
|
|
|
useTabs: true,
|
|
|
|
tabWidth: 4,
|
|
|
|
braceStyle: '1tbs',
|
|
|
|
},
|
2024-06-14 10:03:06 +02:00
|
|
|
},
|
|
|
|
{
|
2024-06-18 11:42:33 +02:00
|
|
|
files: [
|
|
|
|
'.editorconfig',
|
|
|
|
'.gitattributes',
|
|
|
|
'.gitignore',
|
|
|
|
'.prettierignore',
|
|
|
|
],
|
|
|
|
options: {parser: 'sh', keepPadding: true, minify: false},
|
2024-06-14 10:03:06 +02:00
|
|
|
},
|
|
|
|
{
|
2024-06-18 11:42:33 +02:00
|
|
|
files: ['.arcconfig', '.arclint', '.arcunit', '.imgbotconfig'],
|
2024-06-14 10:03:06 +02:00
|
|
|
options: {parser: 'json'},
|
|
|
|
},
|
|
|
|
{
|
2024-06-18 11:42:33 +02:00
|
|
|
files: ['.vscode/*.json', '**.hujson'],
|
|
|
|
options: {parser: 'jsonc'},
|
2024-06-14 10:03:06 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
files: '.yamllint',
|
|
|
|
options: {parser: 'yaml'},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|