From the course: Node.js: Testing and Code Quality

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Linting your codebase

Linting your codebase

- [Instructor] The ability to Lint the entire code base is built into ESLint. The trick is making it useful. Switch back to VS code. From the terminal we're going to use NPX to run ESLint but this time we're going to specify dot, which is the current directory, press Enter. Well, there's over 1000 errors but a lot of these aren't actually in our custom code and our false positives. If I scroll up, contrib is third-party code. This is a very real-world situation. A single codebase can include many different types of functionality. Of course the Node.js application itself is included. There's also tests, which may use a different environmental configuration. The front end may use different coding standards such as supporting legacy browsers. Finally, similar to testing third-party code should be excluded because you're not maintaining it. To address this type of situation, ESLint configuration files support a…

Contents