- How to use tooling as a safety net for your code.
- Use it automatically to check the code you write
- And automatically run tests.
- LINTING =
a way to automatically check JavaScript code for errors. - This can be done via your:
-
- editor (live linting)
-
- build process
-
- pre-commit hook in version control
There is a difference of CodeStyle Linting vs Syntax Linting.
-
- Syntax (Structural) Linting= checks for
JavaScript Anti-patterns, like:unreachble statementsand forget astrict comparison against null.
- Syntax (Structural) Linting= checks for
-
- Code Style Linting = to know errors regarding
- incorrect camel cases of `variables
- particular incorrect `braces {}[] for functions.
NOTE: The linting ONLY checks for intentional errors.
-
YET, it doesn´t have any idea of what you are trying to accomplish with your code.
-
A linter helps your code to:
-
- uncover code style problems
-
- help eliminate dead code or variables
- Use
Unit Testto test the functionality of your project. - To test the Front-End code in the browser.