Eslint error in VSCode


#1

I have no idea what I’ve done today to cause eslint to stop working in my text editor. I ran an update to npm and know I get this error in the VSCode console. I’ve been messing around with it for an hour but haven’t had any luck. Can someone please let me know what I’m missing here.

ESLint stack trace:
Error: Cannot find module 'babel-runtime/helpers/slicedToArray’

Path: package.json

"dependencies": {
    "@babel/runtime": "^7.0.0-beta.48",
    "@fortawesome/fontawesome": "^1.1.8",
    "@fortawesome/fontawesome-free-regular": "^5.0.13",
    "@fortawesome/fontawesome-free-solid": "^5.0.13",
    "@fortawesome/react-fontawesome": "0.0.18",
    "bcrypt": "^2.0.1",
    "bootstrap": "^4.1.1",
    "jquery": "^1.12.4",
    "meteor-native-mongo": "^0.2.0",
    "meteor-node-stubs": "^0.3.2",
    "moment": "^2.22.1",
    "obj-clean": "^2.0.0",
    "prop-types": "^15.6.1",
    "random-utility": "^1.0.1",
    "react": "^16.4.0",
    "react-datepicker": "^1.4.1",
    "react-dom": "^16.4.0",
    "react-router-dom": "^4.2.2",
    "reactstrap": "^5.0.0",
    "validator": "^9.4.1"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.3",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-import-resolver-meteor": "^0.4.0",
    "eslint-plugin-import": "^2.12.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-meteor": "^4.2.2",
    "eslint-plugin-react": "^7.8.2"
  }

#2

I’ve checked my devDependencies in a recent project and they match yours, with the exception that I also have "@meteorjs/eslint-config-meteor": "^1.0.5",. However, I don’t think that’s the cause of your error.

What do you mean by that?


#3

I think you need to add the package babel-runtime as well as the @babel/runtime.

meteor npm install --save babel-runtime

It’s confusing with 2 packages and very similar names.


#4

Good point. I have seen that in the dependencies along with @babel/runtime (although I’m not using both). However, eslint is part of devDependencies, so I’m not sure if a runtime dependency will affect it.


#5

That was it. Thanks for that.