Prettier & Linters Flashcards
1
Q
What is the order of precedence of the configuration of prettier?
A
- A “prettier” key in the package.json file
- A “.prettierrc” file (Optional extension .json)
- A “.prettierrc.js” file
2
Q
Why use Prettier?
A
It makes it easy to keep a single and consistent style guide when working on a project.
3
Q
Prettier vs Linters, what’s the difference?
A
Linters have two types of rules: Formatting rules & Code-quality rules. Code-quality rules check for potential mistakes in your code. For example: no-unused-vars check for variables that are not used.
4
Q
Why does Prettier have very few options?
A
Because it’s whole purpose is to stop the on-going debates over styles.
5
Q
What is the order of precedence of the configuration of ESLint?
A
- Configuration Comments
2. A “.eslintrc.*” configuration file