drama-prettier-standard-config
v1.0.0
Published
use the same prettier config for all drama projects
Readme
README
Prettier Config to use all over our projects.
In order to use the same Prettier Config in all our projects without having to manually copy the rules every time, we created this library that we can use in all our projects.
How do I get set up?
include package
npm i --save-dev [email protected]:dramahh/drama-prettier-config.gitinclude prettier
npm i --save-dev prettierinclude prettier for twig
npm i --save-dev @zackad/prettier-plugin-twigadd .prettierignore with
# Ignore artifacts:
build
coverage
config
.ddevadd prettier.config.js with
import dramaPrettierConfig from 'drama-prettier-config';
import prettierPluginTwig from '@zackad/prettier-plugin-twig';
export default {
...dramaPrettierConfig,
plugins: [...(dramaPrettierConfig.plugins || []), prettierPluginTwig],
overrides: [
...(dramaPrettierConfig.overrides || []),
{
files: '*.twig',
options: { parser: 'twig' },
},
],
// add project-specific rules here
};(optional) add prettier script to package.json:
"prettier": "npx prettier . --write"How to use it?
run Prettier:
npx prettier . --writerun prettier with script
npm run prettierHow to change the config in this repo?
- change rules in the index.js
- change version number in the package.json
- install the newest version of this config in your repo
