# wxml/empty-tag-self-closing
# Background
Tag Self Closing
All wechat miniprogram wxml tag can be self closing, same with eslint-plugin-react
's self-closing-comp (opens new window) rule, but for wxml
.
# Motivation
Reduce code size and for better code style, easy to code review.
<!-- ✓ GOOD -->
<view bind:tap="clickhandler" />
<view />{{interpolation}}</view>
<view />text</view>
<view /><sub /></view>
<!-- ✗ BAD -->
<view bind:tap="clickhandler" ></view>
<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/empty-tag-self-closing": "error" }
# Version
This rule was introduced in eslint-plugin-wxml v0.2.1