Comments (32)
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.
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.
@nkbt I will try to create a repo with example witch causes this error. Let me some time to do it.
from eslint-loader.
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.
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.
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.
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.
You don't have this issue if used as a loader before (=> after in the array definition) of babel-loader?
from eslint-loader.
I do have it in this case as well.
from eslint-loader.
The issue seems related to eslint. Not this loader.
Do you get the same issue via eslint cli?
from eslint-loader.
@MoOx I don't get this issue using eslint
cli directly.
from eslint-loader.
@MoOx I seems that I also don't have it using eslint
cli directly.
from eslint-loader.
I have the exact same issue with all the latest packages installed. Using eslint-loader as a preloader fails!
from eslint-loader.
@MoOx please reopen it until it will be fixed.
from eslint-loader.
Would love to re-open, but I don't have sufficient rights to do so!
Let me know. Thx.
from eslint-loader.
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.
Having the same problem
from eslint-loader.
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.
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.
This might be related babel/babel-eslint#199 / babel/babel-eslint#202 but I am not sure
from eslint-loader.
@MoOx I'm using "babel": "^6.0.15"
from eslint-loader.
"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.
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.
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.
@MoOx Could you please tell us about the progress?
from eslint-loader.
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.
Everything is now working great for me after upgrading to the latest babel, etc..
Thanks. G.
from eslint-loader.
Problem was in babel-loader, for babel@5 you may use [email protected] it works fine with preLoaders
from eslint-loader.
Thanks for reporting this babel issue.
from eslint-loader.
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.
@stilllife00 did you find out how to fix it?
from eslint-loader.
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)
- Loader reporting syntax errors when dealing with typescript files HOT 10
- TypeError: CLIEngine is not a constructor HOT 1
- Different lint results between webpack and cli HOT 1
- How to now fail the build on error or warning HOT 2
- Combining eslint-loader + vue + typescript causes the build to fail on the first run, but work on the second run HOT 2
- please update minimist due to prototype pollution (CVE-2020-7598) HOT 8
- Cannot read property 'range' of null HOT 3
- vscode integration
- exclude option not working. HOT 12
- Eslint-loader is not using .eslintrc.js configuration HOT 1
- failOnError option doesn't work with ts-loader and webpack-dev-server HOT 8
- CLIEngine has been deprecated HOT 1
- eslint-plugin-import fails to load properties with eslint-loader but works with stand alone eslint HOT 1
- Parsing error: Unexpected token .. HOT 1
- Cannot read property 'getFormatter' of undefined HOT 2
- Missing plugin referenced by .eslintrc file in ignored node_modules folder causes warning HOT 4
- Plugin "import" was conflicted HOT 2
- eslint-laoder failing the build even if the failOnError set to false HOT 2
- relative path is wrong when use eslint-loader in monorepo HOT 1
- Deprecate eslint-loader HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-loader.