➜beslintgit:(master)✗eslint-vv3.15.0➜beslintgit:(master)✗npminstall-geslint-config-airbnbeslint-plugin-jsx-a11yeslint-plugin-importeslint-plugin-react/Users/next/.nvm/versions/node/v7.5.0/lib├──UNMETPEERDEPENDENCYeslint@^3.15.0├─┬eslint-config-airbnb@14.1.0│└──UNMETPEERDEPENDENCYeslint@^3.15.0├─
我一直在玩ES6和angular,我正在使用eslint-plugin-angular来验证我的javascript。我有以下服务:exportfunctionrunBlock($rootScope,$state,$log){'ngInject';$rootScope.$on('$stateChangeStart',function(event,toState){//...});但是eslint给我以下错误:The"$on"callshouldbeassignedtoavariable,inordertobedestroyedduringthe$destroyevent我的意思是我理解
是否可以根据文件扩展名对文件应用不同的规则?例如,我的源代码中有[test].spec.js测试规范文件,但我喜欢添加仅适用于它们的规则。 最佳答案 这是添加的。文档here文档中的例子{"rules":{"quotes":[2,"double"]},"overrides":[{"files":["bin/*.js","lib/*.js"],"excludedFiles":"*.test.js","rules":{"quotes":[2,"single"]}}]}有效地,您可以提供glob和一组规则,这些规则覆盖匹配每个glob的文
我试图在我的JS项目中使用装饰器,但是ESLint抛出一个错误,指出@符号是一个意外的字符。我的代码:@observableitems=[];我的.eslintrc:{"parserOptions":{"ecmaVersion":6,"ecmaFeatures":{"jsx":true},"sourceType":"module"},"env":{"browser":true,"node":true,"es6":false},"ecmaFeatures":{"modules":true},"rules":{"strict":[2,"global"],"quotes":[2,"singl
我尝试部署fireabase示例,但是当我尝试部署它时,CLI启动错误:[代码]constfunctions=require('firebase-functions');//toactivatefirebasefunctionsconstadmin=require('firebase-admin');//toactivefirebasedatabasepermissionsadmin.initializeApp(functions.config().firebase);exports.addMessage=functions.https.onRequest((req,res)=>{//
当我从我的存储库的根文件夹运行eslint时,一切运行正常,没有错误。但是当我从子文件夹运行时,我得到大量导入/Unresolved问题,而当我从根目录运行时不会发生:/reporoot/subfolder0/subfolder1/MyFile.js11:8errorUnabletoresolvepathtomodule'foo'import/no-unresolved11:8errorMissingfileextensionfor"foo"import/extensions14:97errorUnabletoresolvepathtomodule'foo'import/no-unre
我在安装eslint时遇到以下错误:npmERR!Darwin15.4.0npmERR!argv"/usr/local/bin/node""/usr/local/bin/npm""install""-g""eslint"npmERR!nodev5.5.0npmERR!npmv3.8.8npmERR!path/usr/local/lib/node_modulesnpmERR!codeEACCESnpmERR!errno-13npmERR!syscallaccessnpmERR!Error:EACCES:permissiondenied,access'/usr/local/lib/node
现状在我们当前的项目中,我们遇到了一些反复出现的问题,人们使用来自seamless-immutable的“asMutable”实际上没有必要的地方。这导致“搜索字符串“asMutable”的项目”成为每个拉取请求的一部分。为了加快速度,我们想在我们的eslint中添加一条警告规则。但我还没弄明白怎么办。问题虽然我乐于接受建议,但对我来说现在最好的解决方案是允许我指定要禁止的函数名称的规则。ESlint或相应的插件是否具有这种功能?附加说明我有点想写我们自己的,但我被AST吓到了以及编写我的第一条规则的启动难度。如果我找不到更好的答案,我可能会冒险,是的,我们在PR中得到了足够多的答案来
我是Grunt-csslint插件的新手,在我运行cssLint任务完成后,有很多错误和警告我无法跟进。那么如何配置任务只打印出错误,而不是警告?? 最佳答案 如果您使用grunt-contrib-csslint您可以在.csslintrc文件中指定选项。来自grunt-contrib-csslint自述文件:OptionsAnyspecifiedoptionwillbepassedthroughdirectlytocsslint,thusyoucanspecifyanyoptionthatcsslintsupports.Thecs
我使用create-react-app,我想使用来自./src的绝对导入。丹·阿布拉莫夫recommended我添加了.env和NODE_PATH=src并且它有效。但我的eslint不明白该模块已经存在。我收到错误import/no-unresolved和import/extensions这是我的eslint配置:module.exports={parser:'babel-eslint',extends:'airbnb',rules:{'react/no-did-mount-set-state':'off','import/no-extraneous-dependencies':'o