关于eslint 支持jQuery中的$符

来源:4-2 集成bootstrap后台管理模板ace

纯情的慕哥

2020-06-30

这个需要怎么配置不报错呢?

写回答

2回答

等待就是浪费_青春

2020-06-30

在.eslintrc.js文件下的module.exports中,为env添加一个键值对 jquery: true 就可以了。

module.exports = {

root: true,

env: {

node: true,

jquery: true 

},

'extends': [

'plugin:vue/essential',

'eslint:recommended'

],

rules: {

'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',

'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',

'no-undef': 'off',

'vue/no-unused-vars': 'off',

'vue/require-v-for-key': 'off',

'no-unused-vars': 'off',

'vue/no-unused-components': 'off'

},

parserOptions: {

parser: 'babel-eslint'

}

};


3
2
慕仰1201119
谢谢大佬
2020-07-05
共2条回复

甲蛙

2020-07-01

点赞,这个可以的

1
0

Spring Cloud+ Vue前后端分离开发企业级在线视频系统

全网稀缺课程 市场热门项目+主流框架 一课掌握前后端技术

1743 学习 · 1697 问题

查看课程