Giter Site home page Giter Site logo

Comments (32)

MoOx avatar MoOx commented on May 30, 2024 1

This module is open source and covered by tests. It is very easy to start working on it: clone the project, the npm install && npm test.

So if you encounter a bug, please take the time to fix it (reminder: Open Source projects work even better with multiples contributors).

If don't want to take the time to fix it because you have others priorities, at least make a pull request with a failing test to expose the bug to the world in order to facilitate things for people that will fix it.

Thanks !

from eslint-loader.

nkbt avatar nkbt commented on May 30, 2024

This is strange, I've got exactly same setup and don't have any issues.

Maybe you need babel-eslint in your .eslintrc?

from eslint-loader.

mdreizin avatar mdreizin commented on May 30, 2024

@nkbt I will try to create a repo with example witch causes this error. Let me some time to do it.

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

It seems you just need babel-eslint as a parser for eslint ;)
Reopen if that is not the case, but each time I got this issue, it's just that I use an esNOTEXISTING feature :)

from eslint-loader.

iurii-kondratiuk-zz avatar iurii-kondratiuk-zz commented on May 30, 2024

I have the same issue even if I add babel-eslint parser to .eslintrtc:

module.exports = {
  module: {
    preLoaders: [
      {test: /\.js$/, loader: "eslint-loader", exclude: [/node_modules/, /lib/]}
    ],
    loaders: [
      {test: /\.js$/, loader: "babel-loader", exclude: [/node_modules/, /lib/]}
    ]
  }
}
{
  "env": {
    "browser": true,
    "es6": true
  },
  "parser": "babel-eslint"
}

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

What is your input file that trigger an "Unexpected token" issue?
This have probably nothing to do with the fact that you are using eslint as a preloader.
But if you think it is, making a pull request to add a failing test might help us :)

from eslint-loader.

iurii-kondratiuk-zz avatar iurii-kondratiuk-zz commented on May 30, 2024

It fails on this line and it works fine if I remove the preloader:

import { accountService } from 'services/account.service.js';

And it says:

... Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| import { accountService } from 'services/account.service.js';
|
...

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

You don't have this issue if used as a loader before (=> after in the array definition) of babel-loader?

from eslint-loader.

iurii-kondratiuk-zz avatar iurii-kondratiuk-zz commented on May 30, 2024

I do have it in this case as well.

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

The issue seems related to eslint. Not this loader.
Do you get the same issue via eslint cli?

from eslint-loader.

mdreizin avatar mdreizin commented on May 30, 2024

@MoOx I don't get this issue using eslint cli directly.

from eslint-loader.

iurii-kondratiuk-zz avatar iurii-kondratiuk-zz commented on May 30, 2024

@MoOx I seems that I also don't have it using eslint cli directly.

from eslint-loader.

gegles avatar gegles commented on May 30, 2024

I have the exact same issue with all the latest packages installed. Using eslint-loader as a preloader fails!

from eslint-loader.

mdreizin avatar mdreizin commented on May 30, 2024

@MoOx please reopen it until it will be fixed.

from eslint-loader.

gegles avatar gegles commented on May 30, 2024

Would love to re-open, but I don't have sufficient rights to do so!

Let me know. Thx.

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

Can someone open a PR with a failing test?
I don't have the issue at the moment, maybe it's related to a recent eslint change?

from eslint-loader.

schickling avatar schickling commented on May 30, 2024

Having the same problem

from eslint-loader.

Halama avatar Halama commented on May 30, 2024

Hi I have the same issue. I wasn't able to run the tests without errors yet. So I've create the repository which demonstrates the bug https://github.com/Halama/eslint-loader-debug

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

Thanks a lot, that will helps. It's look like it's related to your version of babel.

Can everyone involved here tell which version of babel you are using? babel@6?

(I still use babel@5, that probably why I don't have the issue yet)

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

This might be related babel/babel-eslint#199 / babel/babel-eslint#202 but I am not sure

from eslint-loader.

iurii-kondratiuk-zz avatar iurii-kondratiuk-zz commented on May 30, 2024

@MoOx I'm using "babel": "^6.0.15"

from eslint-loader.

schickling avatar schickling commented on May 30, 2024
    "babel-core": "^6.1.2",
    "babel-eslint": "^4.1.4",
    "babel-loader": "^6.0.1",
    "babel-preset-es2015": "^6.1.2",
    "babel-preset-react": "^6.1.2",
    "babel-runtime": "^6.0.14",

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

So like I said, it looks like it is related to the babel-eslint issue mentioned above (not upgraded to babel 6 yet).

from eslint-loader.

mdreizin avatar mdreizin commented on May 30, 2024

I don't use babel@6 and here is my config:

{
    "babel": "^5.8.29",
    "babel-core": "^5.8.30",
    "babel-loader": "^5.3.2",
    "eslint": "^1.7.3",
    "eslint-loader": "^1.1.0",
    "webpack": "^1.12.1"
}

I have the same issue using babel-eslint.

from eslint-loader.

mdreizin avatar mdreizin commented on May 30, 2024

@MoOx Could you please tell us about the progress?

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

I didn't do anything yet because I don't have the issue with all my current project atm.

Also see #66 (comment) if you want to help.

from eslint-loader.

gegles avatar gegles commented on May 30, 2024

Everything is now working great for me after upgrading to the latest babel, etc..

Thanks. G.

from eslint-loader.

Laiff avatar Laiff commented on May 30, 2024

Problem was in babel-loader, for babel@5 you may use [email protected] it works fine with preLoaders

from eslint-loader.

MoOx avatar MoOx commented on May 30, 2024

Thanks for reporting this babel issue.

from eslint-loader.

pastinepolenta avatar pastinepolenta commented on May 30, 2024

same problem here after migrating to Webpack 2.0 even with babel-loader 6 and 7

ERROR in ./src/index.jsx
Module parse failed: /var/www/images-shelf/node_modules/eslint-loader/index.js!/var/www/images-    shelf/src/index.jsx Unexpected token (18:12)
You may need an appropriate loader to handle this file type.
| render() {
|         return (
|             <h1>
|                 Test
|             </h1>

"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.2.2",
"babel-jest": "^18.0.0",
"babel-loader": "^6.4.1",

"eslint": "^3.12.2",
"eslint-config-airbnb": "^13.0.0",
"eslint-loader": "^1.7.1",

rules: [
        {
            enforce: "pre",
            test: /\.jsx?$/,
            loaders: "eslint-loader",
            include: [
                config.paths.src
            ]
        },

from eslint-loader.

NicolasRannou avatar NicolasRannou commented on May 30, 2024

@stilllife00 did you find out how to fix it?

from eslint-loader.

NicolasRannou avatar NicolasRannou commented on May 30, 2024

OK my issue was that I was using rules + loaders at the same time. Only using rules fixes it!

from eslint-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.