# wxml/required-root-tag
# Background
Required Tags
Hint required tags for wxml file, sometimes we need special tag as root tag for some reason. same with wxml/required-tags
but for root tag.
# Motivation
hint developer don't forget add required tag
as root tag
for special wxml file
{
"wxml/required-root-tag": ["error", "page"]
}
<app name="e-commerce">
<main />
<list />
</app>
💡 tips
You can edit code via online editor, it's online REPL, try to fix eslint problem !
# Config
"wxml/required-root-tag": [<enabled>, string]
# Config Example
{
"wxml/required-root-tag": ["error", "page"]
}
{
"overrides": [
{
"files": ["src/**/*-page.wxml"],
"plugins": ["wxml"],
"processor": "wxml/wxml",
"parser": "@wxml/parser",
"rule": {
"wxml/required-root-tag": ["error", "page"]
}
}
]
}
Only lint
*-page.wxml
and check if root tag is<page>
.
# Version
This rule was introduced in eslint-plugin-wxml v0.6.3