Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Problems with ESLint 2.10.1 and babel-eslint #92

Closed
bebraw opened this issue May 15, 2016 · 5 comments
Closed

Problems with ESLint 2.10.1 and babel-eslint #92

bebraw opened this issue May 15, 2016 · 5 comments

Comments

@bebraw
Copy link

bebraw commented May 15, 2016

There's something going on with ESLint 2.10.1, eslint-loader, and babel-eslint combination. They had an issue in 2.10.0 that broken eslint-loader and babel-eslint. It was fixed in 2.10.1. It still fails with eslint-loader, though.

I set up an example illustrating this. If you execute npm run test:lint, the linting process completes successfully. If you run npm start, you'll start seeing errors like this:

ERROR in ./app/index.jsx

.../react-boilerplate/app/index.jsx
  1:1  error  Parsing error: The keyword 'import' is reserved

✖ 1 problem (1 error, 0 warnings)


ERROR in ./app/Notes.jsx

.../react-boilerplate/app/Notes.jsx
  1:1  error  Parsing error: The keyword 'import' is reserved

✖ 1 problem (1 error, 0 warnings)

It's not picking up the parser for some reason. I did try setting

  eslint: {
    configFile: path.join(__dirname, '.eslintrc')
  }

at my common configuration to make sure it really points to the configuration but this didn't have any effect.

It's possible this is ESLint core issue and that their fix missed some corner case breaking ESLint. I am opening the issue here to see if other users are seeing similar behavior with this particular combination.

gkubisa added a commit to gkubisa/elm-app-boilerplate that referenced this issue May 15, 2016
`npm run test:js` fails with ESLint errors when "eslint v2.10.1"
is installed, while "eslint v2.9.0" works fine. Probably the same
issue as reported here: webpack-contrib/eslint-loader#92
@MoOx
Copy link
Contributor

MoOx commented May 16, 2016

Waiting for eslint/eslint#6182 to be fixed.

@swarthy
Copy link

swarthy commented May 16, 2016

As a temporary solution you can set parser in query in webpack.config.js

preLoaders: [
      {
        test: /\.js$/,
        loader: 'eslint?parser=babel-eslint',
        exclude: /node_modules/,
      }
    ],

@sebinsua
Copy link

I'm getting an error which looks like:

  1:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

Not sure if it's the same problem.

@bebraw
Copy link
Author

bebraw commented May 16, 2016

@sebinsua You could try against eslint/eslint#6183 . There's a proposed fix.

@bebraw
Copy link
Author

bebraw commented Jul 27, 2016

Closing given the combination works again. 👍

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

No branches or pull requests

4 participants