# wxml/required-tags
# Background
Required Tags
Hint required tags for wxml file, sometimes we need special tags for some reason. For example, our page
.wxml need <page></page>
to inject some common logic. This rule is for that case.
# Motivation
hint developer don't forget add required tags
for special wxml file
{
"wxml/required-tags": ["error", "observer", "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-tags": [<enabled>, ...string[]]
# Config Example
{
"wxml/required-tags": ["error", "page"]
}
{
"overrides": [
{
"files": ["src/**/*-page.wxml"],
"plugins": ["wxml"],
"processor": "wxml/wxml",
"parser": "@wxml/parser",
"rule": {
"wxml/required-tags": ["error", "page"]
}
}
]
}
Only lint
*-page.wxml
and check<page />
if it exist.
# Version
This rule was introduced in eslint-plugin-wxml v0.6.2