@illumini/prettier-config
v0.1.5
Published
Illumini's base Prettier configuration.
Downloads
2
Maintainers
Readme
prettier-config
This package provides Illumini's base prettier
configuration.
Pairs well with our ESLint configuration
.
Table of Contents
Installation
npm
npm install --save-dev @illumini/prettier-config
If you don't have it installed already, also install prettier
as a devDependency.
npm install --save-dev prettier
yarn
yarn add --dev @illumini/prettier-config prettier
Configurations
We export one ESLint configuration for your usage:
Default Config
Create a prettier.config.js
file at the root of your project that contains:
module.exports = require('@illumini/prettier-config');
Editor Integration & Autoformatting
VS Code
Install Prettier extension:
View → Extensions
then find and install Prettier - Code formatterReload the editor
In your VS Code user settings
Code/File → Preferences → Settings
orCMD/CTRL + ,
click the{}
icon in the top right corner to modify yoursettings.json
file// Format on save with Prettier rules "editor.formatOnSave": true,
Pre-commit Hook
As another line of defence, if you want ESLint to automatically fix your errors on commit, you can use lint-staged
with husky
, which manages git hooks.
npm install --save-dev lint-staged husky
In your
package.json
:{ "lint-staged": { "*.js": ["eslint --fix"] }, "husky": { "hooks": { "pre-commit": "lint-staged" } } }
Publishing to npm
Read npm's docs on How to Update a Package.
npm login
- Make sure you're logged into illumini's npm account with the credentials from 1pass.
npm whoami
will tell you if you're already logged in.
- Make sure you're logged into illumini's npm account with the credentials from 1pass.
npm version <update_type>
update_type
can bepatch
,minor
, ormajor
. If you don't know which one to use, go read about semantic versioning.
npm publish