Project Tech Linting - Vincentvanleeuwen/project-tech-2020 GitHub Wiki
Linters
A linter is a tool that analyses your code for stylistic or programmatic errors. You can run a linter on your app.js, it will then analyse the file and print the errors in your terminal.
A linter uses a config file. For ESLint that is a .eslintrc.json file. In this file you can set a bunch of rules for your linter. You can for instance set the EcmaScript version, so it can read all the functions that you're using in that EcmaScript version.
It's also possible to use other peoples settings. You could use prettier as an extension, it applies all the rules that prettier uses.
My Setup
I have chosen to use ESLint as my linter. In the beginning I had a couple problems with it. My computer wouldn't allow me to use
$ npx eslint --init
So I had to come up with my configuration file manually. I like a lot of space in between my code. Therefore I added rules such as padded-blocks, and newline-per-chained-call to check for empty lines after functions, and within functions.
My Config
Here is an example of my own ESLint config file
Sources
"Configuring ESLint" Retrieved from: https://eslint.org/docs/user-guide/configuring