Arondight/eslint-plugin-check-json-value

支持条件检查

Closed this issue · 0 comments

{
  "rules": {
    "check-json-value/json-value": [
      "error",
      [
        {
          "file": "data/record-202[1-2]\\.json",
          "path": "data.records[0].id",
          "values": ["^\\d{4,6}$", "^null$"],
          "if": [
            {
              "path": "data.records[0].name",
              "values": ["^Mr Cat$"]
            }
          ]
        }
      ]
    ]
  }
}