Eslint 只在一个 sublime text 项目中工作?

Eslint only working in one sublime text project?

我复制了一个项目 .eslintrcpackage.json 文件,只有第一个项目得到了 linting。第二个项目没有显示任何错误。

这是我的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"
  }

这是我的 .eslintrc

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

如有任何帮助,我们将不胜感激。

尝试在 package.json 中将 ESLint 降级为 ~2.2.0 或使用默认的 Espree 解析器而不是 babel-eslint。现在 ESLint 2.3.0 和 babel-eslint 之间存在不兼容性。我们正在跟踪 eslint/eslint#5476 的进展,您可以订阅该问题以获取更新。