Tools / Package Managers Flashcards

1
Q

what is Prettier

A

Tool that autoformats your code for you

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

explain npm i -D

A

same as:
~~~
npm install –save-dev

~~~

dev dependency means that application will work fine without it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Prettier vs ESLint

Formatter vs Linter

A

Linters have two categories of rules:
1. Formatting rules: eg: max-len, no-mixed-spaces-and-tabs, etc…
2. Code-quality rules: eg no-unused-vars, no-extra-bind, no-implicit-globals

Prettier does not not help with Code-quality Rules. It only does formatting.

use Prettier for formatting and linters for catching bugs!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is npm

A

the package manager for Node.js.

npm allows you to bring in code from the npm registry which is a bunch of open source modules that people have written so you can use them in your project.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What we want from a build tool

A
  1. Organization - We can separate files out for code organization and have a tool stitch them together for us
  2. Download Dependencies - We can include external, third-party libraries from npm (like React!)
  3. Optimize Code - The tool will optimize the code for us by minifying and other optimizing techniques

Build tool examples: Vite, Parcel, Webpack

React community has currently selected Vite as tool of choice

How well did you know this?
1
Not at all
2
3
4
5
Perfectly