Use eslint automatically in the ide

workspace
javascript
ide

#1

I have installed eslint correctly, like the following on my cloud 9 (c9) environment:

npm install -g eslint 
eslint --init

I would like to actively use eslint with c9 on the one hand to get errors fixed, but on the other hand to point out inconsistencies within my js. However, I haven`t found any configuration page or way to add it directly to the ide.

Any suggestions how to add my configuration to c9 and run the eslint command automatically?

Appreciate your replies!


#2

eslint is already included in Cloud9, so there’s no need to install it. To configure it, create a .eslintrc file in the root of your workspace, and add your configuration. Cloud9 will automatically lint your code as you write it, and display any problems next to the line numbers on the left.


#3

@dannytech

Thx for your answer! I would be glad, if you could provide an explanation how to add the .eslintrc to the configuration?

Thx in advance!


#4

There is the official guide, available here:

To get started, create a .eslintrc.json file in the file tree (I believe you can also use .eslintrc, but to follow their instructions, the JSON version works as well). Then, you can configure ESLint as you wish according the the above reference, as well as add file-level configurations.


#5

This has been a while now, but I’m having some issues getting eslint working as this thread implies.
I created a blank workspace, installed create-react-app and generated a react app from this.
As mentioned I’ve added the .eslintrc.json file to the project and it has this in it:
{
“extends”: “airbnb”
}

but it doesn’t seem to be working.