ESLint and Prettier are 2 importants tools in the JS tools belt. How to make them aware of each other? Here is how.
From:
/*https://dev.to/gajus/my-favorite-css-hack-32g3*/ | |
* { background-color: rgba(255,0,0,.2); } | |
* * { background-color: rgba(0,255,0,.2); } | |
* * * { background-color: rgba(0,0,255,.2); } | |
* * * * { background-color: rgba(255,0,255,.2); } | |
* * * * * { background-color: rgba(0,255,255,.2); } | |
* * * * * * { background-color: rgba(255,255,0,.2); } | |
* * * * * * * { background-color: rgba(255,0,0,.2); } | |
* * * * * * * * { background-color: rgba(0,255,0,.2); } |
function undefined() { | |
// problem solved | |
} | |
From: https://dmitripavlutin.com/7-tips-to-handle-undefined-in-javascript/ | |
#js #undefinedNullHell |
ESLint and Prettier are 2 importants tools in the JS tools belt. How to make them aware of each other? Here is how.
From:
# Create a user named ozon, for example | |
create user ozon with encrypted password 'ozon'; | |
# Create a database (see LC_CTYPE and LC_COLLATE if needed) | |
create database ozon with owner ozon encoding 'UTF8'; |
//https://codesandbox.io/s/quirky-hermann-1xzju?file=/src/App.js | |
import React, { useState, useEffect } from "react"; | |
import "./styles.css"; | |
const useAuth = Component => { | |
const [isAuthed, setAuth] = useState(false); | |
useEffect(() => { | |
setTimeout(() => { | |
setAuth(true); |
// try it : https://codesandbox.io/s/sample-next-ts-rhf-zod-9ieev | |
import React from "react"; | |
import { useForm } from "react-hook-form"; | |
import { zodResolver } from "@hookform/resolvers/zod"; | |
import { z } from "zod"; | |
import type { FieldError } from "react-hook-form"; | |
// JSON.stringify(error) will not work, because of circulare structure. So we need this helper. |
import { SWRConfig } from "swr"; | |
import { fetcher } from "@services/apiClient"; | |
// Your fetcher need to throw error with an statusCode. | |
const MyApp = () => { | |
return ( | |
<SWRConfig | |
value={{ |