npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pico-intl-dev/ts-plugin

v1.0.7

Published

TypeScript language service plugin for pico-intl - autocomplete, hover, and diagnostics for t() calls

Readme

@pico-intl-dev/ts-plugin

TypeScript Language Service plugin for pico-intl: autocomplete, hover, diagnostics, and go-to-definition for translation function calls.

License Version

Experimental editor tooling. The plugin has automated TypeScript LanguageService coverage, but it should not be considered stable until it has broader IDE coverage across real editor versions.

Features

| Feature | Description | | --- | --- | | Autocomplete | t('nav.') shows matching keys with translated values | | Hover info | Hovering t('nav.home') shows the base-locale value | | Go to definition | Cmd/Ctrl-click jumps to the locale JSON key | | Diagnostics | Optional warnings on unknown keys, missing params, extra params, and obvious number mismatches through strictMode | | Auto-reload | Registry reloads when locale JSON files change |

Param diagnostics are intentionally conservative. They run on literal object arguments and avoid guessing when params are built dynamically. They understand pico-intl core placeholders and common full ICU MessageFormat params, including nested plural/select trees, selectordinal, and number/date/time arguments.

Install

npm install --save-dev @pico-intl-dev/ts-plugin

Configuration

Add the plugin to tsconfig.json:

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@pico-intl-dev/ts-plugin",
        "localesDir": "./locales",
        "baseLocale": "en",
        "functions": ["t", "i18n.t", "$t"],
        "strictMode": false
      }
    ]
  }
}

VS Code

The plugin requires the workspace TypeScript version, not VS Code's built-in TypeScript.

Add to .vscode/settings.json:

{
  "typescript.tsserver.pluginPaths": ["./node_modules"]
}

Then run TypeScript: Select TypeScript Version and choose Use Workspace Version.

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | localesDir | string | "./locales" | Path to locale JSON files | | baseLocale | string | "en" | Locale used for hover display values | | functions | string[] | ["t","i18n.t","$t","useT"] | Function call patterns to detect | | strictMode | boolean | false | Show warning diagnostics for unknown keys and literal param mistakes |

Examples

Autocomplete:

t('nav.')
// Suggestions include:
// nav.home
// nav.about
// nav.contact

Hover:

t('nav.home')
// "Home" [en]
// pico-intl key: nav.home
// File: ./locales/en.json

Strict diagnostics:

t('nav.doesnotexist')
// [pico-intl] Translation key "nav.doesnotexist" not found in en.json

t('user.greeting')
// [pico-intl] Translation key "user.greeting" requires params: name: value

t('user.greeting', {})
// [pico-intl] Missing param "name" for translation key "user.greeting"

t('user.greeting', { name: 'Ana', unused: true })
// [pico-intl] Extra param "unused" is not used by translation key "user.greeting"

t('billing.price', { price: '12' })
// [pico-intl] Param "price" for translation key "billing.price" should be a number

t('activity.feed', { gender: 'female' })
// [pico-intl] Missing param "count" for translation key "activity.feed"

Architecture

The plugin is loaded by tsserver, not by your application runtime. It:

  1. Reads locale JSON files from localesDir at startup.
  2. Watches the locale directory and reloads keys after changes.
  3. Decorates the TypeScript LanguageService proxy for completions, hover, definitions, and diagnostics.
  4. Has zero runtime cost in the app because all work happens in the language server process.

Verification

From the repository root:

npm run test:ts-plugin

The test creates a real TypeScript LanguageService, loads the plugin, and verifies completions, hover, unknown-key diagnostics, param diagnostics, go-to-definition, external locale file registration, malformed locale file tracking, and locale reload behavior.

Production notes

  • Treat this as assistive editor tooling, not build enforcement.
  • Use pico-intl validate --strict, pico-intl check --src ./src --strict --complete, or pico-intl doctor --src ./src --ci for release-blocking catalog validation.
  • Editor behavior can differ across VS Code, TypeScript versions, and workspace plugin settings.

License

MIT