A Simple Linter Setup…Finally!
▻https://hackernoon.com/a-simple-linter-setup-finally-d908877fa09?source=rss----3a8144eabfe3---4
Mr. LinterA linter flags anything in your code that breaks its pre-defined rules.Each “style guide” has different opinions/rules about what constitutes “good” #javascript code. This post uses Airbnb’s style guide; Google’s is also popular.Some developers install their linter globally, but I’m going to show you how to be more precise by creating a custom configuration for each project.First, let’s set up #eslint (one of the most popular linter tools). Luckily, ESLint has a magical tool built right in! ?$ cd PROJECT$ npx eslint —initThis will ask a series of questions about your desired set up. My choices:Use a popular style guideAirbnb(depends if using React)JavaScriptYesI’m using yarn, why did it create a package-lock.json file!? ?$ rm package-lock.json$ yarn installSkip to ⚛️ if you used Create (...)