'Syntax error in database rules while deploying

While deploying my website to firebase,i get a syntax error in database rules showing:

2:5: Expected rules property.

I am listing down the code in json

{
    "hosting": {
        "public": "public",
        "ignore": [
            "firebase.json",
            "**/.*",
            "**/node_modules/**"
        ]
    },
    "database": {
        "rules": "firebase.json"
    },
    "emulators": {
        "auth": {
            "port": 9099
        },
        "database": {
            "port": 9000
        },
        "hosting": {
            "port": 5000
        },
        "ui": {
            "enabled": true
        }
    }
}


Solution 1:[1]

The rules value should point to a rules file, not at the firebase.json file itself. Something like:

"rules": "database.rules.json"

That rules file must define valid database rules. For example:

{
  "rules": {
    ".read": false,
    ".write": false
  }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 abraham