# wxml/no-inline-wxs
# Background
.wxs file and tag
WXS code can be written in <wxs />
tags in a wxml file or in files with the extension .wxs
.
# Motivation
This rule enforce developer use .wxs
file instead of <wxs />
, for better IDE support. (e.g. VSCode detect .wxs
as .js
, and then you can get full js language feature support)
<!-- ✓ GOOD -->
<wxs module="util" src="../../../util.wxs" />
<!-- ✗ BAD -->
<wxs module="util" >
function util () {
// balabala
}
module.exports = {
util: util
}
</wxs>
💡 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/no-inline-wxs": "error" }
# Version
This rule was introduced in eslint-plugin-wxml v0.2.1