eslint-plugin-wxml 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
eslint-plugin-wxml 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
eslint-plugin-wxml 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
开源组织
地区 国产
投 递 者 chenchen99
适用人群 未知
收录时间 2021-11-01

软件简介

eslint-plugin-wxml

为 lint 微信小程序 wxml 文件而开发的 eslint 插件,可使用 eslint 来检查微信小程序项目内的 wxml 代码

vscode eslint-plugin-wxml

当开发者使用 VSCode 或者 Webstorm 时可以得到代码错误提示,目前支持的 lint 规则如下:

1. wxml/colon-style-event-binding 强制使用:冒号隔开时间绑定

2. wxml/empty-tag-self-closing 空标签必须自闭合

3. wxml/forbid-tags 配置禁止使用的 wxml 标签

4. wxml/max-depth 设置 wxml 组件树最大深度

5. wxml/max-len 设置单行代码最大宽度

6. wxml/max-lines 设置单个 wxml 文件最多代码行数,防止产生巨形单组件

7. wxml/no-const-and-let-in-wxs 禁止在 wxs 内使用 let 和 const,目前微信小程序 wxs 只支持 var 声明变量

8. wxml/no-dot-this-in-wx-key 禁止使用 *this 作为wx:key

9. wxml/no-duplicate-attributes 禁止出现重复的组件属性

10. wxml/no-dynamic-wx-key 禁止使用动态wx:key

11. wxml/no-index-in-wx-key 禁止使用 index 作为wx:key

12. wxml/no-inline-wxs 禁止使用内联wxs

13. wxml/no-unexpected-string-bool 禁止使用true/false字符串,产生预期外的行为

14. wxml/no-unnecessary-block 优化block的使用

15. wxml/no-vue-directive 禁止在微信小程序里错误的使用 vuejs 相关指令

16. wxml/quotes 设置单双引号的代码风格 

17. wxml/report-wxml-syntax-error 允许提示wxml语法错误

18. wxml/report-wxs-syntax-error 允许提示内联wxs里的js语法错误

19. wxml/required-attirbutes 设置组件必填属性参数

20. wxml/wx-key 允许提示循环时缺少wx:key声明

21. wxml/wxs-module-prop 允许提示wxs标签module属性相关检查   

22. wxml/wxs-must-be-top-level 强制要求wxs必须为顶层标签

规则相关配置请查看文档: https://eslint-plugin-wxml.js.org , 如果没有满足需求的rule,请到Github项目仓库提issue

展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣
发表了资讯
2021/11/05 09:53

微信小程序 eslint 插件 eslint-plugin-wxml v0.4.1 发布

eslint-plugin-wxml 微信小程序eslint插件 eslint-plugin-wxml 于2021年11月5日发布了新版v0.4.1 1. 新增了规则 wxml/no-wx-if-string,用于校验警告在使用wx:if/wx:elif时必须使用有效的布尔值插值,否则会产生预期之外的结果 <view wx:if="{{user}}"> {{user.name}}</view> If you use wx:if/wx:elif as control flow, make sure wx:if/wx:elif's value is a boolean, not a string (or dynamic string), otherwise the val...

2
1
发表了资讯
2021/11/02 22:04

微信小程序 eslint 插件 eslint-plugin-wxml v0.4.0 发布

eslint-plugin-wxml eslint-plugin-wxml 于2021年11月2日发布了新版v0.4.0 1. 新增了规则 wxml/no-wx-for-with-wx-if,用于校验警告不允许在同一个标签上同时使用 wx:for 和 wx:if以及wx:elif wx:else 2.修复了规则 wxml/no-unnecessary-block, 针对使用 <block />标签包裹单个循环列表的场景取消了警告 官方文档地址: https://eslint-plugin-wxml.js.org 相关代码变更详见 https://github.com/wxmlfile/eslint-plugin-wxml/com...

1
1
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
3 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部