angularjs – 如何导入eslint插件导出的环境?
发布时间:2020-12-17 07:01:57 所属栏目:安全 来源:网络整理
导读:我看到在 https://github.com/Gillespie59/eslint-plugin-angular/blob/master/environments.js子部分模拟eslint-plugin-angular声明了注入全局变量. 如何从我的应用程序导入这些环境设置?我试过“延伸”:“棱角分明”但是eslint仍然抱怨: 7:14 error 'in
我看到在
https://github.com/Gillespie59/eslint-plugin-angular/blob/master/environments.js子部分模拟eslint-plugin-angular声明了注入全局变量.
如何从我的应用程序导入这些环境设置?我试过“延伸”:“棱角分明”但是eslint仍然抱怨: 7:14 error 'inject' is not defined no-undef 我尝试添加: "env": { "angular/mocks": true } 到配置,但后来我得到了 Environment key "angular/mocks" is unknown 解决方法
您收到此错误是因为ESLint只能使用插件而不是配置所暴露的环境.您必须在配置文件中注册eslint-plugin-angular作为插件:
"plugins": ["angular"],"env": { "angular/mocks": true } 如果仍然无效,则应使用–debug标志运行ESLint,以查看配置是否已正确加载并应用了环境.您还可以使用–print-config标志运行ESLint,后跟存储库中某个文件的路径,以查看ESLint在使用该文件时将使用的所有规则和全局变量. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- 格式化来自shell的GitHub提交消息
- Angular2 – http呼叫代码覆盖
- My First SmartDevice Application ---Demo
- 国内yum源的安装(163,阿里云,epel)
- 在进行sem_timedwait时,我如何应对系统时间的变化
- 【WebService框架-CXF】——CXF+Spring+Struts+自
- kubernetes /var/lib/docker目录迁移
- 角度 – 离子4:“加载控制器”dismiss()在prese
- 如何在Angular 2中使用React的this.props.childr
- angular – 如何导入highcharts-更多
热点阅读