Skip to content

jhanikhilnath/eslint-config-nikhil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. If you don't already have a package.json file, create one with npm init.

  2. 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

  1. You can see in your package.json there are now a big list of devDependencies.

  2. 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:-

  1. Eslint extention shows all the errors in VS Code problems Window and underlines them

  2. 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.