# wxml/wxs-must-be-top-level
# Backgroud
wxs
<wxs />
can be located at top level in wxml
, also can be nested.
# Motivation
This rule enforce every wxs
must be top level, for better code style
<!-- ✓ GOOD -->
<!-- top level wxs -->
<wxs module="util" src="../../utils.wxs" />
<!-- ✗ BAD -->
<view>
<view>
<!-- nested wxs -->
<wxs module="util" src="../../../util.wxs" />
</view>
</view>
💡 tips
You can edit code via online editor, it's online REPL, try to fix eslint problem !
# Config
No special options, normal config is ok
{ "wxml/wxs-must-be-top-level": "error" }
# Version
This rule was introduced in eslint-plugin-wxml v0.3.0