- Avoid using
anyas much as possible.- If you want a type meaning "any object", use
Record<string, unknown>instead.
- If you want a type meaning "any object", use
- If you want a type meaning "any value", you probably want
unknowninstead.
This repo uses a CSS-in-JS library called Emotion for its styling.
Emotion is a performant and flexible CSS-in-JS library. Building on many other CSS-in-JS libraries, it allows us to style apps quickly with string or object styles. It has predictable composition to avoid specificity issues in CSS. With source maps and labels, Emotion has a great developer experience and performance with heavy caching in production.
Also, Material UI v5 will most likely use Emotion instead of JSS:
material-ui - [RFC] v5 styling solution
- Use
remunits forfont-sizeandline-height.- The user preferences are respected.
- We can change the apparent
pxvalue ofremto whatever we'd like.
- Use
px,%orvwfor layout purposes.- For example, when using
margin,padding,width,height, etc. - Easier to implement design requirements.
- Why not
remhere as well?
- For example, when using
- Layout can break when changing the base browser font-size.
https://prettier.io/docs/en/options.html#trailing-commas
When set to none...
- Often forgetting to add a comma when adding entries to an Object.
- Commenting a property in an object currently removes the comma from the property above it.
- Moving the last property of an object up requires an extra step to add a comma at the end.
- Messes up Git diff and sometimes creates conflicts.
| { | |
| "[html]": { | |
| "editor.defaultFormatter": "esbenp.prettier-vscode" | |
| }, | |
| "[javascript]": { | |
| "editor.defaultFormatter": "esbenp.prettier-vscode" | |
| }, | |
| "[javascriptreact]": { | |
| "editor.defaultFormatter": "esbenp.prettier-vscode" | |
| }, |
Moment.js is now considered a legacy project (see Moment.js Project Status).
eslint-plugin-unicorn v19.0.0 added unicorn/no-null by default.
The reasoning behind it:
Intent to stop using null in my JS code
Some good Pros/Cons summary from that thread:
sindresorhus/meta#7 (comment)
The rule only restricts using null as explicit values for variables or function arguments.
| #!/usr/bin/env bash | |
| # References: | |
| # https://docs.travis-ci.com/user/environment-variables | |
| # | |
| # Inspired by: | |
| # https://gist.github.com/willprice/e07efd73fb7f13f917ea | |
| # But using SSH keys instead of Personal Access Token: | |
| # https://gist.github.com/alexilyaev/2672fe6d99756377fbffaabad6db1f45 |