0.0.2 • Published 1 year ago

eslint-plugin-vue-script v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago
{
  "plugins": ["vue-script"],
  "rules": {
    "vue-script/config-format": ["error", {
      "title": {
        "type": "Literal",
        "typeof": "/^[^\\s.]+$/",
        "required": true
      },
      "constant": {
        "type": "Literal",
        "typeof": "boolean",
        "required": false
      },
      "keepAlive": {
        "type": "Literal",
        "typeof": "boolean",
        "required": true
      },
      "authorize": {
        "type": "ArrayExpression",
        "typeof": "Literal",
        "required": false,
        "children": "string"
      },
      "component": {
        "type": "Literal",
        "typeof": "/^[a-z]+$/",
        "required": false
      },
      "parameter": {
        "type": "ArrayExpression",
        "typeof": "ObjectExpression",
        "required": false,
        "children": {
          "key": {
            "type": "Literal",
            "typeof": "/^[a-z][a-zA-Z]+$/",
            "required": true
          },
          "value": {
            "type": "Literal",
            "typeof": "/^[^\\s.]+$/",
            "required": true
          },
          "required": {
            "type": "Literal",
            "typeof": "boolean",
            "required": true
          }
        }
      },
      "permission": {
        "type": "ArrayExpression",
        "typeof": "ObjectExpression",
        "required": false,
        "children": {
          "key": {
            "type": "Literal",
            "typeof": "/^[a-z]+$/",
            "required": true
          },
          "title": {
            "type": "Literal",
            "typeof": "/^[^\\s.]+$/",
            "required": true
          },
          "api": {
            "type": "Literal",
            "typeof": "/^\/[a-zA-Z\/]+$/",
            "required": false
          }
        }
      }
    }, {
      "includes": ["views/**/*/index.vue"]
    }]
  }
}
<script lang="ts">
export default {
  title: '页面标题',
  constant: true,
  keepAlive: true,
  component: 'poc',
  permission: [
    {
      title: '查询',
      key: 'query',
      api: '/get/list'
    }
  ]
}
</script>
0.0.2

1 year ago

0.0.1

1 year ago