wepy如何关闭格式校验

如果通过修改wepy.config.js中的参数eslint:false无法达到效果,则可通过以下方式进行操作。

wepy的格式校验配置文件所在目录:node_modules/@wepy/cli/core/util/xmllint.js

但不能直接手动修改xmllint.js中的配置项源码,因为node_modules中的代码不会同步到仓库中,当其他项目成员拉取代码进行开发时,或者执行了npm install时,node_modules中的代码依旧是默认配置。而此时需要通过nodejs来进行修改|替换。

具体操作方式,已在上一篇文章中进行了详解,地址如下:通过nodejs修改node_modules中的源码https://blog.csdn.net/weixin_44594219/article/details/127206080?spm=1001.2014.3001.5502

以下为对应报错信息需修改的配置的例子:

报错:The value of attribute [ v-if ] must be in double quotes.

需修改的配置:'attr-value-double-quotes': false,

报错:Duplicate of attribute name [ slot ] was found.

需修改的配置:'attr-no-duplication': false,

报错:Do not mix tabs and spaces for indentation.

需修改的配置:  'space-tab-mixed-disabled': false,

配置信息请根据项目需求进行修改。

猜你喜欢

转载自blog.csdn.net/weixin_44594219/article/details/127209359
今日推荐