Skip to content

Instantly share code, notes, and snippets.

View alex-grover's full-sized avatar
Making coffee

Alex Grover alex-grover

Making coffee
View GitHub Profile
import { getAddress } from 'viem'
import { z } from 'zod'
export const address = z
.string()
.transform((val, ctx) => {
try {
return getAddress(val.toLowerCase())
} catch {
ctx.addIssue({
@alex-grover
alex-grover / .lintstagedrc.js
Last active March 13, 2024 17:27
Run `next lint` via `lint-staged` in a monorepo
import path from 'path'
import util from 'util'
import child_process from 'child_process'
const exec = util.promisify(child_process.exec)
const projectDirname = 'web' // Update with the path to your Next.js project
const buildEslintCommand = async (filenames) => {
// `next lint` just silently ignores file inputs if the file doesn't exist,