Socket
Book a DemoInstallSign in
Socket

prettier-plugin-firestore-rules

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-firestore-rules

Firestore Rules formatter plugin for prettier

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

CI MIT-License Dependencies DevDependencies npmVersion

prettier-plugin-firestore-rules

A plugin for prettier to enable autoformatting for Cloud Firestore Security Rules.

A custom built parser for the rules is included.

How to install it

With npm

npm i --save-dev prettier prettier-plugin-firestore-rules

With yarn

yarn add -D prettier prettier-plugin-firestore-rules

How to install it in the CLI

Generally

prettier -w <path/to/file>

Using yarn berry

yarn prettier -w <path/to/file>

Example Usage

Configuration

Create a .prettierrc file and add your preferred configuration options.

Configurations are optional.

Available Options

  • emptyLinesBetweenBlocks
    • Default: 0
    • Adds empty lines between matcher blocks

.prettierrc example

{
  "emptyLinesBetweenBlocks" : 1
}

For more information see Prettier documentation.

To be done

  • Fix some indentation issues
    • Array not correctly indented as function parameter
    request.resource.data.keys().hasOnly(
    ['rank', 'name', 'description', 'imageUrl', 'timeSlot']
    )
    
    • Function parameter in general
    get(
    /databases/$(database)/documents/configurations/someData
    ).data.values.hasAll(request.resource.data.someData)
    
    • if-alignments, sometimes off
             if hasValue('writeSLots', request.auth.uid, carId)
        && zxcv
        && xcvb
    
    • semicolon may be off
    && request.resource.data.timeSlot.to > request.resource.data.timeSlot.from
              ;
    
  • Add formatter options:
    • && at start or end of the line

Keywords

prettier

FAQs

Package last updated on 12 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.