简体   繁体   English

Eslint仅在一个出色的文本项目中工作?

[英]Eslint only working in one sublime text project?

I've duplicated a projects .eslintrc and package.json files, and only the first project gets linting. 我已经复制了一个项目.eslintrcpackage.json文件,并且只有第一个项目可以使用。 The second project doesn't show any errors. 第二个项目没有显示任何错误。

  • I'm using sublime-linter, with the eslint mod. 我正在使用带有eslint mod的sublime-linter。
  • I've set the syntax the same in both projects. 我在两个项目中都设置了相同的语法。
  • I've done an npm isntall 我已经做了一个npm isntall
  • I've tried restarting sublime 我试过重启崇高
  • on doing a comparison of the node_modules folders there is one descrepency, estravers-fb is installed in the project that works. 在对node_modules文件夹进行比较时,有一个缺点,即在有效的项目中安装了estravers-fb。
    • why would this not be installed in the other projects? 为什么不将其安装在其他项目中?
    • is there another command to properly install dev-dependancies other than npm isntall? 除了npm isntall之外,还有其他命令可以正确安装开发依赖吗?

heres my package.json : 这是我的package.json:

  {
    "name": "Read-hapi",
    "version": "1.0.0",
    "description": "learning the hapi framework",
    "repository": "https://github.com/Pushplaybang/learning-hapi.git",
    "main": "server.js",
    "dependencies": {
      "blipp": "^2.3.0",
      "boom": "^3.1.2",
      "cheerio": "^0.20.0",
      "good": "^6.6.0",
      "good-console": "^5.3.1",
      "handlebars": "^4.0.5",
      "hapi": "^13.0.0",
      "inert": "^3.2.0",
      "joi": "^8.0.3",
      "reading-time": "^1.0.2",
      "request-promise": "^2.0.1",
      "text-stats": "0.0.3",
      "valid-url": "^1.0.9",
      "vision": "^4.0.1"
    },
    "devDependencies": {
      "babel-eslint": "^5.0.0",
      "eslint": "^2.3.0",
      "eslint-config-airbnb": "^6.1.0",
      "eslint-plugin-react": "^4.2.0"
    },
    "scripts": {
      "test": "echo \"Error: no test specified\" && exit 1"
    },
    "author": "Paul van Zyl",
    "license": "ISC"
  }

and heres my .eslintrc 这是我的.eslintrc

      {
        "parser": "babel-eslint",
        "extends": "airbnb",
        "env": {
          "browser": true,
          "node": true,
        },
        "rules": {
          "no-unused-vars": 0,
          "no-undef": 0,
        }
      }

any help would be appreciated. 任何帮助,将不胜感激。

Try downgrading ESLint to ~2.2.0 in your package.json or using the default Espree parser instead of babel-eslint. 尝试降级ESLint至~2.2.0在您的package.json或使用默认Espree解析器,而不是通天-eslint的。 There's an incompatibility right now between ESLint 2.3.0 and babel-eslint. ESLint 2.3.0和babel-eslint之间现在不兼容。 We're tracking progress in eslint/eslint#5476 , and you can subscribe to that issue for updates. 我们正在eslint / eslint#5476中跟踪进度,您可以订阅该问题以进行更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM