Package Exports
- config-prettier
- config-prettier/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (config-prettier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Badges
Config-Prettier
Config-Prettier is a JavaScript package that provides a set of best practice configurations for Prettier, a code formatter that helps you maintain consistent code style in your projects. This package aims to simplify the setup process for Prettier by providing a predefined configuration and a set of recommended plugins.
Features
- Consistent and opinionated code formatting rules.
- Preconfigured to work with popular plugins.
- Easy installation and integration into your projects.
Installation
npm install --save-dev config-prettierUsage/Examples
Once Config-Prettier is installed, you can add it to your project's package.json file to set up Prettier scripts. Here's an example of how to add the scripts to your package.json:
"scripts": {
// ...
"lint:check": "prettier --check \"**/*.{js,ts,tsx,md,mdx,json}\"",
"lint:fix": "prettier --write \"**/*.{js,ts,tsx,md,mdx,json}\""
},
"prettier": "config-prettier",
// ...The lint:check script will check your code for Prettier formatting violations, and the lint:fix script will automatically fix them.
.prettierrc.cjs
module.exports = {
...require('config-prettier'),
// Override rules if needed, check https://prettier.io/docs
};This configuration file extends the rules defined in Config-Prettier and allows you to override them if necessary.
Plugins
Config-Prettier depends on several Prettier plugins to enhance its functionality. You do not need to install these plugins separately; they are included with Config-Prettier by default.:
- prettier-plugin-prisma
- prettier-plugin-sort-json
- prettier-plugin-tailwindcss
- prettier-plugin-package-perfection
With Config-Prettier and its bundled plugins in place, your project's code formatting will adhere to best practices and remain consistent throughout development. Happy coding!