Questions tagged [babel-eslint]
38 questions
64
votes
4 answers
Eslint not ignoring node_modules folder
Somehow after updating Babel from 6 to 7 my eslint started giving such a warning in node_modules:
So, from my understanding node_modules folder is not ignored and that is why the issue popped up. So, reading through eslint…

Nikita Vlasenko
- 4,004
- 7
- 47
- 87
56
votes
3 answers
ESLint: Parsing error: This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (2:9)
I am trying to use ESLint in WebStrom, but it doesn't work and displays an error:
ESLint: Parsing error: This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (2:9).
Here is my .eslintrc and…

skull Kim
- 597
- 1
- 4
- 5
26
votes
12 answers
Error: Failed to load parser 'babel-eslint' declared in '.eslintrc': Cannot find module 'babel-eslint' in create-react-app
Trying to install eslint into create-react-app, but get next error when running linter:
Here is my .eslintrc config file:
{
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "babel-eslint"
}
If install…

Alexandr Tovmach
- 3,071
- 1
- 14
- 31
10
votes
1 answer
eslint-config-standard with @babel/plugin-proposal-class-properties
Problem
I'm setting up eslint with eslint-config-standard.
I'm also using babel plugin that @babel/plugin-proposal-class-properties.
I tried lint my javascript files by "eslint index.js" command, and I got error that "[eslint]: Parsing error:…

socker210
- 137
- 9
6
votes
2 answers
Typescript casting with babel eslint parsing
I am getting some parsing errors after introducing ESLint into an existing Typescript codebase.
I have fixed most of the lint errors but babel-eslint as a parser throws quite a few errors like this:
23:32 error Parsing error: Unexpected token,…

RyanP13
- 7,413
- 27
- 96
- 166
5
votes
1 answer
@babel/eslint-parser throwing error on vue files
I have set up eslint-webpack-plugin with @babel/eslint-parser and eslint-plugin-vue on my webpack and vue project, but when I try to check the vue files it throws the following error:
Error in phone-link.vue
1:0 error Parsing error: This…

Pete
- 57,112
- 28
- 117
- 166
5
votes
4 answers
What am I doing wrong in my ESLint file so import will not be alerted?
After reading a few Q&As regarding my issue of:
Parsing error: 'import' and 'export' may appear only with 'sourceType:
module'
ignore ESLint error: 'import' and 'export' may only appear at the top level
What is the correct way of using import…

DᴀʀᴛʜVᴀᴅᴇʀ
- 7,681
- 17
- 73
- 127
3
votes
3 answers
Parsing error: Cannot find module 'next/babel' in my Next.js app
I know there are a lot of answers like this, this or this out there and some people may flag my question as duplicate, but believe me I am struggling with this because neither of them is working for me now. Those were working before but looks like…

Tayyab Ferozi
- 464
- 1
- 6
- 20
3
votes
0 answers
Running into "Cannot find module" while configuring Babel + ESLint
I created a simple app a few weeks ago using create-react-app almost immediately I started getting this error in VSCode about it not being happy about something Babel related...which I ignored. My app works, I'm able to build and deploy to Heroku.…

Maddox Grey
- 61
- 1
- 6
3
votes
1 answer
Preventing ESLint "no-undef" on ReactJS arrow-function class properties
I'm trying to get @babel/plugin-proposal-class-properties to work with @babel/eslint-parser and ESLint. I have lots of class methods written like this:
class MyClass extends PureComponent {
...
someProperty = () => { ... } // < ESLint:…

Eva
- 99
- 1
- 7
3
votes
1 answer
babel.config.js babel eslint turn off / disable a rule
I would like to deactivate a babel eslint rule no-unused-vars.
if using to eslint (not babel-eslint) I would add the following
.eslintrc.js
rules: {
'no-unused-vars': 'off'
}
So I tried adding the same code to
babel.config.js
module.exports…

art vanderlay
- 2,341
- 4
- 35
- 64
3
votes
0 answers
How to configure eslint on vue-cli project to work correctly
I have a vue project that build successfully, but when I add in the eslint option in package.json file I receive Parsing error: Unexpected token pointing at a private variable. I have been researching for the last few hours and have been…

John Dover
- 739
- 1
- 8
- 19
2
votes
0 answers
no-unused-vars throwing Error rather than Warning?
We recently updated several NPM packages and other parts of our React application, and now no-unused-vars is throwing an error rather than a warning.
One of the updates to our application was updating from babel-eslist to @babel/eslint-parser in…

Canovice
- 9,012
- 22
- 93
- 211
2
votes
1 answer
Install ESLint + babel-eslint parser globally on Windows 10
I unsuccessfully tried to install ESLint globally running with babel-eslint as parser. I installed both packages globally on a Windows 10 machine:
npm list --depth=0 -g
C:\Users\UserName\AppData\Roaming\npm
+-- @angular/cli@8.3.9
+--…

FelHa
- 1,043
- 11
- 24
1
vote
0 answers
eslint ignores files included via `importScripts`
I'm working on webextension and have service_worker.js with the following code:
importScripts("debug.js")
debug.log("blah");
The debug.js contains:
const debug = console.bind(console);
eslint gives error:
'debug' is not defined.…

vanowm
- 9,466
- 2
- 21
- 37