ユーザースクリプトなどであまりライブラリ使いたくない人へ
生DOMの要素作るマン
JSX pragma 風味
import React from 'react'; | |
import { getImageProps } from 'next/image'; | |
import Accessibility from '../../assets/accessibility.svg'; | |
import AvifImage from '../../assets/avif-test-image.avif'; | |
const Component = (props) => { | |
const { | |
props: { srcSet: dark }, | |
} = getImageProps({ src: Accessibility, alt: 'Theme Example', ...props }); |
const rules = | |
require("@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules").default; | |
const displayRule = (ruleKey) => { | |
const rule = rules[ruleKey.replace("@typescript-eslint/", "")]; | |
if (!rule) { | |
return ruleKey; | |
} | |
return `${rule.meta.deprecated ? " 💀" : ""} ${ruleKey} - ${ | |
rule.meta.docs.description |
[..."タチツテト"].flatMap(c1 => [..."ラリルレロ"].map(c2 => `${c1}${c2}`.repeat(2))).join("\n") |
import { type ReactRenderer, composeStories } from "@storybook/react"; | |
import type { Store_CSFExports, PreparedStoryFn } from "@storybook/types"; | |
import { render } from "@testing-library/react"; | |
import { glob } from "glob"; | |
import preview from "../.storybook/preview"; | |
import { setProjectAnnotations } from "@storybook/react"; | |
import { join } from "path"; |
openapi: 3.1.0 | |
info: | |
title: TODO 管理ツール API | |
version: 1.0.0 | |
servers: | |
- url: https://dev.example.com/api/v1 | |
description: エンドポイント(開発) | |
- url: https://example.com/api/v1 | |
description: エンドポイント(本番) | |
tags: |
import type { LowerHttpMethod, AspidaResponse } from "aspida"; | |
import { | |
rest, | |
ResponseResolver, | |
RestContext, | |
RestRequest, | |
DefaultBodyType, | |
} from "msw"; | |
/** |
import SwaggerParser from "@apidevtools/swagger-parser"; | |
import * as OpenAPISampler from "openapi-sampler"; | |
import type { OpenAPI, OpenAPIV3_1 } from "openapi-types"; | |
SwaggerParser.dereference( | |
"oepnapi.json" | |
).then((api) => { | |
if (!api.paths) throw new Error("No paths found in API definition"); | |
Object.entries<NonNullable<OpenAPI.Document["paths"]>[number]>( |
for (const el of document.querySelectorAll( | |
"a[href^='https://bizboard.nikkeibp.co.jp/houjin/cgi-bin/nsearch/md_pdf.pl']:not([class])" | |
)) { | |
// wait 1s | |
await new Promise((res) => setTimeout(res, 1000)); | |
el.download = ""; | |
el.click(); | |
} |