--only-changed
変更したテストだけ実行できる- 結構便利そう。けどテストじゃなくて関連するソースの変更を検知したい
- https://playwright.dev/docs/api/class-testconfig#test-config-respect-git-ignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const requireComment = { | |
meta: { | |
type: "suggestion", | |
docs: { | |
description: "useEffectにはコメントでの説明が必須です。", | |
}, | |
schema: [], | |
messages: { | |
requireCommentOnUseEffect: `useEffectにはコメントでの説明が必須です。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update pnpm catalog with interactive | |
# pnpm catalog: https://pnpm.io/ja/catalogs | |
# fzf: https://github.com/junegunn/fzf | |
# yq: https://github.com/kislyuk/yq | |
selected_cataglogs=$(pnpm outdated --recursive --json | jq -r 'to_entries[] | .key + ": " + .value.current + " → " + .value.latest' | fzf --multi) | |
echo $selected_cataglogs | while read line ; do | |
pkg_name=$(echo "$line" | cut -d: -f1) | |
pkg_version=$(echo "$line" | cut -d' ' -f4) | |
echo "Update $pkg_name to $pkg_version" | |
yq -i ".catalog += {\"$pkg_name\": \"$pkg_version\"}" pnpm-workspace.yaml |
next/font
の関数からパラメータを組み立ててhttps://fonts.googleapis.com/css2?family=xxx
に対してリクエスト
- ダウンロードしたCSSの
src: url(...)
を抜き出してwebfontファイルを保存
- ダウンロードしたCSSの
src: url(...)
を保存したファイルパスへ書き換え
- Created: 2024-07-28
- Updated: https://gist.github.com/azu/ac5dafbf211ef8b5ecf386930ac75250/revisions
Node.jsのTypeScriptサポートに関する議論を時系列でまとめたものです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type BaseEnvRecord = Record< | |
string, | |
{ | |
value: string | undefined; | |
required: boolean; | |
defaultValue?: string; | |
} | |
>; | |
export type ReturnTypeOfCreateEnv<T extends BaseEnvRecord> = { | |
// If the value is required, it should be a string, otherwise it should be a string or undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// ベースのtsconfigは決められたカテゴリのみを設定する | |
// それ以外は、プロジェクトごとに設定する | |
// https://www.typescriptlang.org/tsconfig/#compilerOptions | |
"compilerOptions": { | |
// incrementalビルドは特別にデフォルトで有効にする | |
"incremental": true, | |
// # JavaScript Support | |
"allowJs": false, | |
// # Type Checking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useActionState } from "react"; | |
const validate = _ => {}; | |
const isValidationError = _ => {}; | |
const isNetworkError = _ => {}; | |
const DisplayError = ({ | |
error, | |
}: { | |
error: ReturnType<typeof usePage>["error"]; | |
}) => { | |
if(isValidationError(error)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const draw = (output) => console.log(output); | |
const getWeather = async (city) => { | |
await new Promise((resolve) => setTimeout(resolve, 1000)); | |
return "sunny"; | |
}; | |
const render = async function* ({ city }) { | |
yield `<Spinner />`; | |
const weather = await getWeather(city); | |
return `<Weather info=${weather} />`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api.mapkey("g", "Kagi to Google", function () { | |
const isKagi = location.href.startsWith("https://kagi.com/search?"); | |
if (isKagi) { | |
location.href = `https://www.google.com/search?q=${(new URL(location.href)).searchParams.get("q")}`; | |
} | |
}); |