Skip to content

Latest commit

 

History

History

linters-formatters-husky

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Module Description

  • Get to know:
    • Linters
    • Formatters
    • Husky
  • Explore reasons to use these tools
  • Get to know how to install and configure these tools

Linters, formatters, and tools like Husky are essential for front-end developers for several reasons:

  1. Linters: A linter is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. This allows developers to catch and fix issues before they become problems. This is especially important in front-end development as it can prevent potential issues that might affect the user interface or user experience.

  2. Formatters: Code formatters automatically format your code to a certain style guide. This ensures consistency across your codebase, making it more readable and maintainable. It also eliminates the need for developers to spend time formatting code themselves, allowing them to focus on solving more complex tasks.

  3. Husky: Husky is a tool used for automating the use of Git hooks. These hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git's internal behavior and trigger customizable actions at key points in the development life cycle. For example, you can set up a pre-commit hook to run linter and tests before every commit, ensuring that only validated code makes it into the repository.

In conclusion, these tools help in maintaining code quality, consistency, and enforcing rules, which is necessary for efficiency, collaboration, and preventing errors in large codebases. They also automate some tasks, which allows developers to focus on writing code.

Educational Materials

  1. Watch the video about linters
  2. Read the article about linters
  3. Read the article about Prettier
  4. Read the article about Prettier and ESLint duo
  5. Watch the video-tutorial how to work with ESLint and Prettier in VSCode
  6. Read docs about ESLint rules
  7. Read Husky - Get started

Optional Materials

  1. Prettier documentation
  2. ESLint configuration (docs)
  3. Popular style guides
  4. Comparison of popular linters for JavaScript (optional)
  5. Why Prettier