ESLint | Linter for JS file

ESLint is the Javascript linter. It is similar to JSLint.

How to add ESLint in the project?

First you have to add the node module in the project. For adding node module you have to check this link to create node module.

After installing the node module in the project we need to install the eslint in it.

For that run below command

npm install --save-dev eslint

This will install the eslint package in the node module.

Now to check the eslint package is present or not use the below command:

ls node_modules/eslint

The eslint command operates through the .bin folder which is created. To check the .bin folder for eslint use:

ls -la node_modules/.bin

Now if you test the ESLint in the code by using the below code.

./node_modules/.bin/eslint components/

It will provide error to add the configuration file.

To set the configuration file you have to add the code.

/node_modules/.bin/eslint --init

Then it will ask bunch of question for configuration.

Once you will add the question the configuration file will be added and the ESLint is ready to use.

To use you can use the command:

./node_modules/.bin/eslint components/

Till now I have research this much about ESLint.

Reference site from where I learn the ESLint:


How we will be a standard Coder?

We all know how to develop a website. If at all we don’t know then we can be google it and learn it. But very often we search about how can we become a standard coder.

Let me tell you I face many challenges to become a standard corded and I am facing it till date.

Below are the points which I learn in the process of being a standard coder.

  1. Update with the latest tools and technology trends. First thing I search a lot what are the standards and all everywhere I found that “Be updated with the latest tools and technology”. Hell yeah, this is true.
  2. Interact with the people whom codes are standard. This is a really good point to interact with people. They are the best person who can suggest what to do. I did it and trust me in first I feel some shyness but people who have knowledge are way more than all this.
  3. PHP CodeSniffer  This is the latest tool which you can install in your PC and check your coding standard.

These points are the basic and very theoretical points. Let me know if you need more descriptive or technical points. I love to share them as well.