Best Practices
When starting a new project
Use Lerna
Use typescript
Use eslint
Use prettier
Use jest
Use husky
Used to lint files
See https://github.com/aizatto/javascript-repository-template/blob/master/repositories.json
Lerna
https://github.com/lerna/lerna
Update lerna.json
Install
Update package.json
package.json
when creating a new package:
Package Management
Each package manages it's own typescript
and eslint
.
For example, at the root directory.
Use JSON5 over JSON
The JSON5 Data Interchange Format (JSON5) is a superset of JSON that aims to alleviate some of the limitations of JSON by expanding its syntax to include some productions from ECMAScript 5.1.
JSON5 Short Example:
Package Recommendations
commander: command-line arguments
Used by
create-react-app
dotenv
Used by
create-react-app
As early as possible:
JavaScript:
TypeScript:
Or
fs-extra
fs-extra
adds file system methods that aren't included in the nativefs
module and adds promise support to thefs
methods. It also usesgraceful-fs
to preventEMFILE
errors. It should be a drop in replacement forfs
.
Used by
create-react-app
Last updated