@hideoo/prettier-config 📐
HiDeoo's Prettier configuration
Usage
Install
$ pnpm add -D prettier @hideoo/prettier-configConfigure
Reference the configuration in your package.json file:
{
"prettier": "@hideoo/prettier-config"
}Alternatively, you can also extends the configuration through a configuration file. This is particularly useful when using some Prettier plugins, e.g. with a .prettierrc.cjs file:
const baseConfig = require('@hideoo/prettier-config')
/**
* @type {import('prettier').Config}
*/
const prettierConfig = {
...baseConfig,
overrides: [
{
files: '*.astro',
options: {
parser: 'astro',
},
},
],
plugins: ['prettier-plugin-astro'],
}
module.exports = prettierConfigAs of 07/19/2023, Prettier v3 does support ESM configuration files but using an import statement will result in an error in the VSCode Prettier extension.
Run
Add a script in your package.json file to run Prettier:
{
"scripts": {
"lint": "prettier -c --cache ."
}
}License
Licensed under the MIT License, Copyright © HiDeoo.
See LICENSE for more information.