Atom ESLint Setup Help: throwing import errors

After following the section in the Meteor guide concerning ESLint setup, I’m still getting errors like the following:

Does anyone have any idea how to resolve this? My package.json looks like this:

{
  "name": "pincus-site",
  "private": true,
  "scripts": {
    "lint": "eslint .",
    "pretest": "npm run lint --silent"
  },
  "dependencies": {
    "meteor-node-stubs": "^0.2.3"
  },
  "devDependencies": {
    "eslint": "^2.9.0",
    "eslint-config-airbnb": "^8.0.0",
    "eslint-plugin-import": "^1.7.0",
    "eslint-plugin-jsx-a11y": "^1.2.0",
    "eslint-plugin-meteor": "^3.5.2",
    "eslint-plugin-react": "^5.0.1"
  },
  "eslintConfig": {
    "plugins": [
      "meteor"
    ],
    "extends": [
      "airbnb/base",
      "plugin:meteor/recommended"
    ],
    "parser": "babel-eslint",
    "rules": {
      "meteor/eventmap-params": [
        2,
        {
          "templateInstanceParamName": "instance"
        }
      ],
      "import/no-unresolved": [
        2,
        {
          "ignore": [
            "^meteor/"
          ]
        }
      ]
    }
  }
}

Clearly I’m doing something wrong, but I’m unfamiliar with the finer points of ESLint setup and making it work properly with Atom’s linter packages. Can anyone explain this to me like I’m 5?

1 Like

Update: This doesn’t work either and it’s pulled directly from the sample app code:

{
  "name": "pincus-site",
  "private": true,
  "scripts": {
    "lint": "eslint .",
    "pretest": "npm run lint --silent"
  },
  "dependencies": {
    "meteor-node-stubs": "^0.2.3"
  },
  "devDependencies": {
    "eslint": "^2.9.0",
    "eslint-config-airbnb": "^8.0.0",
    "eslint-plugin-import": "^1.7.0",
    "eslint-plugin-jsx-a11y": "^1.2.0",
    "eslint-plugin-meteor": "^3.5.2",
    "eslint-plugin-react": "^5.0.1"
  },
  "eslintConfig": {
    "parserOptions": {
      "ecmaVersion": 6,
      "sourceType": "module"
    },
    "plugins": [
      "meteor"
    ],
    "extends": [
      "airbnb/base",
      "plugin:meteor/recommended"
    ],
    "rules": {
      "meteor/eventmap-params": [
        2, {
          "eventParamName": "event",
          "templateInstanceParamName": "instance"
        }
      ],
      "import/no-unresolved": [
        2, {
          "ignore": [
            "^meteor/"
          ]
        }
      ],
      "meteor/template-names": [
        0
      ]
    }
  }
}

Solved: It was Atom’s “Use global ESLint” option – it wasn’t seeing the Meteor and React/Babel based packages.