Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-plugin-html eslint-config-node
| // ~/server/middleware/proxy.ts | |
| import { defineEventHandler } from 'h3' | |
| import { createProxyMiddleware } from 'http-proxy-middleware'; // npm install http-proxy-middleware@beta | |
| const apiProxyMiddleware = createProxyMiddleware({ | |
| target: 'https://jsonplaceholder.typicode.com', | |
| changeOrigin: true, | |
| ws: true, | |
| pathRewrite: { | |
| '^/api/todos': '/todos', |
| <script setup lang="ts"> | |
| import { io } from 'socket.io-client' | |
| const connected = ref(false) | |
| onMounted(() => { | |
| const socket = io(); | |
| socket.on('connect', () => { | |
| connected.value = socket.connected |
| import React from 'react'; | |
| import { | |
| Container, | |
| Header, | |
| Content, | |
| Footer, | |
| FooterTab, | |
| Button, | |
| Icon, | |
| Text, |
| <script lang="ts"> | |
| import { defineComponent, toRaw } from 'vue' | |
| import { | |
| QueryObserver, | |
| type QueryKey, | |
| type QueryObserverResult, | |
| type QueryClient, | |
| } from '@tanstack/query-core' | |
| type Todo = { | |
| userId: number |
| import { watch, ref } from "vue"; | |
| const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; | |
| const recognition = new SpeechRecognition(); | |
| recognition.continuous = true; | |
| recognition.interimResults = true; | |
| recognition.lang = "en-US"; | |
| export default function useSpeechRecognition() { |
| import * as z from 'zod' | |
| import { defineEventHandler, CompatibilityEvent, useQuery } from 'h3' | |
| const userSchema = z | |
| .object({ | |
| name: z.string().min(4, { message: 'Must be 4 or more characters long' }), | |
| age: z.string().transform((age) => parseInt(age, 10)) | |
| }) | |
| type UnknownKeysParam = "passthrough" | "strict" | "strip"; |
| <template> | |
| <button @click="ping">Ping</button> | |
| </template> | |
| <script setup> | |
| import useCancelToken from './useCancelToken'; | |
| import axios from 'axios' | |
| const cancelToken = useCancelToken(); |
| <template> | |
| <div v-frag> | |
| <slot /> | |
| <v-dialog | |
| v-model="isOpen" | |
| :max-width="options.width" | |
| :persistent="options.persistent" | |
| > | |
| <v-card> | |
| <v-card-title>{{ title }}</v-card-title> |
| import { user } from './store.js' | |
| user.set(window__SK__USER__) |
Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-plugin-html eslint-config-node