linters - sasjakoning/blok-tech-2022 GitHub Wiki

linters

:dash: Linters

Linters are tools you can use to clean and debug your code. They look at your script and find issues and errors and you may have overlooked. Below are a few linters I researched.

Name Pros Cons
JSLint Based on Douglas Crockford's Javascript: The Good Parts Doesn't have much configuration
JSHint Popular, easy to use in your browser
ESLint Popular, lots of configuration and can auto format scripts. Best know among teachers and students

Since I'm only looking for a linter to check my code, my requirements for linters are low.

I decided to go with ESLint since my fellow students use this linter as well which could be useful incase there are issues. JSHint Would be a good alternative since it's very easy to use.

:speech_balloon: Formatters

Formatters make sure your code is easy to read and nice to look at by adding proper indenting and spacing.

Below are a few formatters I researched.

Name Pros Cons
VSCode build in formatter Already installed, generally formats code well (subjective)
Prettier Easy to install through VSCode extensions Doesn't always format the way I prefer (subjective)
Beautify Easy to install through VSCode extensions Less popular

Generally I already try to format my coding properly when I'm working on it. So the build in formatter is enough for me to double check if I formatted correctly.