prettier-config 3.0.0
Install from the command line:
Learn more about npm packages
$ npm install @lottiefiles/prettier-config@3.0.0
Install via package.json:
"@lottiefiles/prettier-config": "3.0.0"
About this version
Shared Prettier configuration.
Install Prettier and this plugin by running:
# Normal repository? Install in the project root.
pnpm add -D prettier @lottiefiles/prettier-config
# Monorepo? Install Prettier in the project root workspace.
pnpm add -DW prettier @lottiefiles/prettier-config
Create a prettier.config.cjs
file in your project root with the contents below:
module.exports = {
...require('@lottiefiles/prettier-config'),
};
Create a npm script entry in the root package.json as follows:
{
"scripts": {
"format": "prettier --loglevel=warn --no-editorconfig --write ."
}
}
You can then run pnpm format
to format your project using the command line or in CI pipelines.
You can use the editor integration options described below to get your files formatted as you save them in the IDE.
Do this only if absolutely required
You can override the company-wide base configuration by setting values in the prettier.config.cjs
file.
module.exports = {
...require('@lottiefiles/prettier-config'),
// Overrides:
semi: false,
};
Read the Editor Integration documentation at the Prettier website for how to integrate with all IDEs.
- Install the
prettier-vscode
extension from the marketplace. - Add the following content to the
settings.json
file:
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
Note: If you prefer to apply the configuration to a project only, add the settings content above to a file named
settings.json
file in the .vscode
folder at the root of your project. Create the file if it does not exist.
Integrate formatting code before code is commited using git pre-commit hook events via lint-staged. (See docs on how to setup lint-staged)
lint-staged.config.cjs
module.exports = {
'*': 'prettier --plugin=prettier-plugin-package --ignore-unknown --loglevel=warn --no-editorconfig --write',
};
See CHANGELOG.md for the latest changes.
Details
- prettier-config
- LottieFiles
- almost 3 years ago
- UNLICENSED
- 9 dependencies
Assets
- prettier-config-3.0.0-npm.tgz
Download activity
- Total downloads 31,059
- Last 30 days 1,117
- Last week 98
- Today 0