Node.js 从eslint全局排除路径
我正在尝试使用命令eslint**/*.js在node.js Express项目上运行一个简单的eslint测试 但是,我收到一条错误消息:Node.js 从eslint全局排除路径,node.js,bash,express,eslint,Node.js,Bash,Express,Eslint,我正在尝试使用命令eslint**/*.js在node.js Express项目上运行一个简单的eslint测试 但是,我收到一条错误消息: You are linting "node_modules/hogan.js", but all of the files matching the glob pattern "node_modules/hogan.js" are ignored. 查看node_modules文件夹内部,问题似乎在于hogan视图
You are linting "node_modules/hogan.js", but all of the files matching
the glob pattern "node_modules/hogan.js" are ignored.
查看node_modules文件夹内部,问题似乎在于hogan视图库安装在一个名为“hogan.js”的文件夹中,这使测试脚本感到困惑,因为它认为该文件夹是一个js文件
我试图通过将文件夹添加到ignorePatterns规范以及eslintignore文件中的excludedFiles属性来排除该文件夹。但是,我无法清除错误消息
"ignorePatterns": ["hogan.js", "node_modules/*", "node_modules/hogan.js"],
"excludedFiles": ["hogan.js"]
我真的不明白为什么测试对这个文件感兴趣,因为它说它被配置为忽略节点路径
谁能解释一下如何让测试忽略该路径
编辑:
我尝试退出VSCode并在Powershell中运行eslint命令,问题就消失了。我已经将VS代码配置为使用Git安装中的Bash shell。使用它似乎是个问题。如果我自己启动bashshell,我也会遇到同样的问题。似乎不需要.eslintignore,也不是问题所在
编辑:
当我将eslint任务分解为Gulp任务时,似乎解决了问题,但我仍然想知道如何修复我最初的glob规范