Arondight/eslint-plugin-check-json-value

路径支持循环

Closed this issue · 0 comments

麻痹的,我是真的菜,多重循环不会写,干脆依次展开得了,例如两个计数器的 1 - 100 循环,展开成一万条规则,全都灌进去。

{
  "rules": {
    "check-json-value/json-value": [
      "error",
      [
        {
          "file": "data/record-202[12]\\.json",
          "path": "records[{}].id",
          "values": ["^\\d{4,6}$", "^null$"],
          "for": [
            {
              "replace": "{}",
              "start": 0,
              "end": 10,
              "step": 3
            }
          ]
        }
      ]
    ]
  }
}