eslint-config-nikhil v2.2.0
Eslint and Prettier Setup
These are my settings for eslint and prettier
What it does
- Lints JavaScript based on the latest standards
- Fixes issues and formatting errors with Prettier
- Lints + Fixes inside of html script tags
- You can see all the rules here - I follow these rules All the Time. You are welcome to change anything you don't like
Installing
I will show you how to install the package locally and in each project as it is the best way to customize it on prject level.
Locally
If you don't already have a
package.json
file, create one withnpm init
.Then we need to install everything needed by the config:
npx install-peerdeps --dev eslint-config-nikhil
npx is not a misspelling of npm its a built in tool
You can see in your package.json there are now a big list of devDependencies.
Create a
.eslintrc.json
file in the root of your project's directory (it should live where package.json does). Your.eslintrc.json
file should look like this:
{
"extends": ["nikhil"]
}
VS Code Setup
You Can install eslint extention and prettier extention these extentions allow you to:-
Eslint extention shows all the errors in VS Code problems Window and underlines them
Prettier Extention allows you to format your code inside VS Code
Add this to your settings.json file(or search in settings GUI)
"editor.formatOnSave": true
This project was inspired by eslint-config-wesbos.