prettier-plugin-firebase-database
v2.0.0
Published
Formatter for Firebase Realtime Database Rules
Downloads
899
Maintainers
Readme
Prettier for Firebase rules
Formatter for Firebase Realtime Database Rules
Usage
Install this package:
npm install --save-dev prettier prettier-plugin-firebase
Then add this line to your prettier.config.js
:
plugins: ["prettier-plugin-firebase-database"],
Finally, run prettier:
prettier --write firebase-database.rules
By default, this plugin would try to parse all files with the extension .rules
as Firebase Realtime Database Rules. You can customize this behavior though
configuration overwrites in your prettier.config.js
or equivalent:
/**
* @see https://prettier.io/docs/en/configuration.html
* @type {import("prettier").Config}
*/
const config = {
plugins: ['prettier-plugin-firebase-database'],
overrides: [
{
files: '*.rules',
options: {
parser: 'prettier-plugin-firebase-database',
},
},
],
};
export default config;