Skip to content

andybons/smartquote

Repository files navigation

smartquote

Smart quote conversion utilities for typographically correct quotes.

Why this exists

Some LLMs (all Anthropic models, for instance) are incapable of outputting smart quotes, even when explicitly asked—and Anthropic has confirmed this won't be fixed anytime soon. This package provides a streaming transform for AI output and an ESLint rule/autofix for vibe-coded JSX/TSX.

Packages

Package Description
smartquote Core library with streaming API, Vercel AI SDK integration, and ESLint plugin
smartquotes (Python) Python port of the core conversion logic

Quick Start

npm install smartquote
import { smartQuotes } from "smartquote";

smartQuotes('"Hello," she said.');
// → “Hello,” she said.

See the package README for full API documentation.

Examples

  • vercel-ai-sdk - Streaming AI responses with smart quote conversion
  • eslint - ESLint plugin for JSX/TSX files

Development

This is a pnpm monorepo.

pnpm install          # Install dependencies
pnpm build            # Build all packages
pnpm test             # Run tests
pnpm lint             # Lint all packages
pnpm check-types      # Type check all packages

License

MIT