安装angular2-notifications后运行lint失败
我最近使用Angular-CLI创建了一个新的Angular4项目.
我遇到的问题是在安装angular2-notifications之后,运行ng lint命令时出错. 错误:
堆栈跟踪 : at new FatalError (C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modulestslintliberror.js:40:23) at Object.findConfiguration (C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modulestslintlibconfiguration.js:47:15) at files.forEach (C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modules@angularclitaskslint.js:36:50) at Array.forEach (native) at lintConfigs.map (C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modules@angularclitaskslint.js:30:19) at Array.map (native) at Class.run (C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modules@angularclitaskslint.js:21:14) at Class.run (C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modules@angularclicommandslint.js:45:25) at Class.Command.validateAndRun (C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modules@angularcliember-clilibmodelscommand.js:128:15) at C:UsersGabrielDocumentsGitHubGo-NoGoGoNoGonode_modules@angularcliember-clilibclicli.js:92:22 我已经转向谷歌这个问题,没有任何运气.我去过GitHub repo,也没有运气. 然后我进入了angular2-notifications包的实际tslint.json文件. 我在顶部看到这个: "rulesDirectory": [ "node_modules/codelyzer" ], 当我删除这3行时,ng lint命令有效. 我的问题是,我在这里遗漏了什么吗?我需要这个命令才能工作,我不认为修改包是一个可接受的解决方案.这是包装本身的一个错误,我应该向他们报告吗? 谢谢
从angular-cli.json中的lint配置中排除node_modules:
"lint": [ { "project": "src/tsconfig.app.json","exclude": "**/node_modules/**/*" },{ "project": "src/tsconfig.spec.json",{ "project": "e2e/tsconfig.e2e.json","exclude": "**/node_modules/**/*" }] angular2-notifications项目显然不应该破坏用户的lint.尽管如此,我认为一个项目不应该尝试不应该编辑的lint代码也是公平的. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |