Instructor: Let's create a new custom npm script called eslint. First, we'll come down to our tests and make a new entry for eslint. Here, we'll call eslint.
We'll pass the catch flag so it won't re-lint things that haven't changed. We'll pass the fix flag, which will auto-fix certain rules that have simple solutions. Then we'll tell eslint to lint all the files in the current path.
Many developers don't like to have many globally installed node modules. You might be tempted to reference the locally installed version of eslint by referencing the node_modules bin folder, or you might be inclined to use the npm bin command.
However, npm does provide many environment variables for you. If you type "npm run environment," it'll list all the environment variables that it adds or updates.
If we run that again and search for the path, then we'll see that npm adds our local bin folder for us, which means we can remove all the additional path information. We'll use the local version.
Now we can go to our terminal and type "npm run-script eslint," or, for short, we could just say, "npm run eslint." That will run our new custom npm script.