@smart-gate/prettier-config
v1.0.3
Published
Configure Prettier for Smart-Gate Co. projects to ensure consistent formatting across all styles.
Downloads
34
Readme
prettier-config
prettier-config
is a custom Prettier configuration package designed to enforce consistent formatting across all Smart-Gate Co. projects. It provides a standard set of formatting rules to ensure uniform code style and improve code readability.
[!WARNING] In order to avoid installation conflicts just delete the mentioned package in your
package.json
.
Installation
To use prettier-config
in your project, follow these steps:
Install Prettier and the Config Package:
Make sure you have Prettier installed in your project. You can install Prettier along with
prettier-config
using npm:npm install --save-dev prettier @smart-gate/prettier-config
Add Prettier Configuration File:
Add This line in your
package.json
file.{ "prettier": "@smart-gate/prettier-config" }
(Optional) Prettier With Eslint:
Prettier rules conlficts with eslints, to keep your mental health well you may want update your
.eslintrc.cjs
file: (I assume you've just chosen our smartgate eslint configs)extends: ["@smart-gate/eslint-config-smartgate", '@vue/eslint-config-prettier/skip-formatting']
Add Prettier Script to
package.json
:To make it easy to format your code, you can add a script to your
package.json
:{ "scripts": { "format": "prettier --write ." } }
You can then run
npm run format
to format your codebase.
Usage
Once you have installed @smart-gate/prettier-config
and set up your Prettier configuration file, you can start using Prettier to format your code. Simply run Prettier as needed:
use the script defined in your package.json
:
npm run format
License
This project is licensed under the MIT License. See the LICENSE file for details.