Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inter] Error running ESLint Error: require(...).getLocationFromRangeIndex is not a function(…) #19

Closed
christianalfoni opened this issue May 11, 2017 · 4 comments

Comments

@christianalfoni
Copy link

Hi there!

I have installed this plugin as instructed on the repo. I am using latest version of Atom with latest version of linter-eslint, and also latest eslint installed to my project. Also latest prettier.

For some reason when I save I get the error in the title of this issue. Not sure where to start here :) The error goes away when I remove the prettier rule from the rules map.

@not-an-aardvark
Copy link
Member

Thanks for the report. This also occurred in #11, although I don't think we ever figured out why. It seems like restarting Atom fixed the issue in #11.

@christianalfoni
Copy link
Author

Hi and thanks for the answer :-)

What I notice is that this only happens when I have React code in my file. I have tried to restart and it did not help. Hm hm...

This is my config file:

module.exports = {
  "parserOptions": {
    "ecmaVersion": 2016,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "env": {
    "es6": true,
    "node": true
  },
  plugins: [
      "prettier",
      "react"
  ],
  extends: [
    "plugin:react/recommended",
    "prettier",
    "prettier/react"
  ],
  rules: {
    "prettier/prettier": "error"
  }
};

@christianalfoni
Copy link
Author

christianalfoni commented May 12, 2017

Okay, I figured it out:

It was my global eslint messing it up. Made sure the "Use global eslint" config at the bottom of the linter-eslint plugin for Atom was turned off and installed eslint and eslint-plugin-react again to my local project.

Thanks for assistance :-)

@iameli
Copy link

iameli commented May 18, 2017

I got the same error in VS Code, with a similar workaround -- I had eslint-plugin-prettier installed globally but not locally.

Mostly throwing this here 'cause it pops up first on Google for the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants