These files will show you what will need to do to setup eslint on your local machine. What you will need:
- Node
- ESLint
- Atom
To begin install Node on your machine. You can do this here.
Once you have Node you can install eslint globally using the command npm i -g eslint
.
In your Atom text editor install the linter-eslint
package. On your mac go to Preferences
then Install
and search linter-eslint
. When the package comes up press the Install
button.
Now that you have eslint installed you can now setup your local environment to use it.
To begin create a package.json
file using the command npm init -y
.
Then install the following packages using npm. npm i -D eslint-config-airbnb-base eslint-plugin-import eslint
Finally, set up your .eslintrc
at the root of you directory and include the necessary rules that you want for your project. I have included an example above for inspiration.
If you have anyquestions feel free to email me at adam.recvlohe@gmail.com
.
Example screenshot of errors for a React project.