Eslint缓存在各个分支之间持久存在吗?

时间:2018-10-09 17:59:02

标签: git gruntjs eslint grunt-eslint

它可能不是eslint缓存。

我正在一个使用自定义eslint插件的项目中工作,该插件在本地package.json中引用(不在npm上发布)。

"special-eslint-plugin": "file:special-eslint-plugin-directory"

但是随后我切换到了没有此软件包的较旧分支。它未安装在node_modules中,也不在package.json中,也未收缩包装,它不是本地目录。当我运行“ npm run lint”(运行grunt lint)时,我得到以下终端输出:

10:31 AM app  $ npm run lint
npm info it worked if it ends with ok
npm info using npm@5.5.1
npm info using node@v8.9.2
npm info lifecycle phApp@1.77.0~prelint: phApp@1.77.0
npm info lifecycle phApp@1.77.0~lint: phApp@1.77.0

> phApp@1.77.0 lint /Users/****/Desktop/app/app/
> grunt lint

Running "lint" task

Running "eslint:target" (eslint) task
Warning: Failed to load plugin special-eslint-plugin: Cannot find module 'special-eslint-plugin' Use --force to continue.

Aborted due to warnings.


Execution Time (2018-10-09 10:31:52 UTC-7)
/ ... /

npm info lifecycle phApp@1.77.0~lint: Failed to exec lint script
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! phApp@1.77.0 lint: `grunt lint`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the phApp@1.77.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/***/.npm/_logs/2018-10-09T17_31_53_336Z-debug.log

因此,我认为eslint缓存在各个分支之间仍然存在,并且认为它需要该软件包。

我尝试过但不限于:

git clean -xfd && npm cache clear --force && nvm use && npm install
  • 重新安装节点和npm
  • 重新安装nvm
  • 删除我的所有全局软件包
  • 禁用我的所有编辑器程序包(我在IDE中使用了linters)
  • 删除本地分支机构
  • 重新启动计算机

我正在使用:

  • 矮人
  • grunt-eslint
  • “节点”:“ 8.9.2”
  • “ npm”:“ 5.5.1”
  • nvm 0.30.2

有一个运行lint的git钩子,因此阻止了我在此分支上完成工作

最有趣的部分是,在我的同事计算机上切换到我所在的分支并运行上面的git clean命令后,这没有发生。因此,这与我的计算机而不是分支有关。

谢谢

1 个答案:

答案 0 :(得分:0)

原来,我的桌面上藏着一个.eslintrc文件

相关问题