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

@swiftuijs/twill-linter

v0.3.1

Published

ESLint flat configurations for Twill with TypeScript rules, original-source diagnostics and safe fixes.

Readme

Twill linter

An ESLint 9/10 flat-config plugin for Twill, a TypeScript-based language with Swift-inspired syntax extensions. Lint .twill and .twillx with typescript-eslint rules, original-source diagnostics and conservative fixes.

Install in your application:

pnpm add -D @swiftuijs/twill-linter eslint

eslint.config.mjs:

import twill from '@swiftuijs/twill-linter';
export default [
  { ignores: ['**/dist/**'] },
  ...twill.configs.recommended,
  { languageOptions: { globals: { console: 'readonly' } } },
];
pnpm exec eslint src
pnpm exec eslint src --fix

recommended supplies standard JS and typescript-eslint recommended rules. recommendedTypeChecked additionally supplies typed rules; Twill files need a nearby tsconfig and are checked against Twill's virtual TypeScript program. Native TS files use typescript-eslint's project service normally. Add ordinary framework/environment globals as with any ESLint project.

recommendedTypeChecked also enables @typescript-eslint/switch-exhaustiveness-check. A switch over a discriminated union must explicitly cover each variant, even when it has a default branch. Adding a variant then exposes missing handlers in both Twill and native TS files. This check is opt-in linting, not a new compiler guarantee; run ESLint in CI to enforce it. Ordinary recommended does not require type information. See practical patterns for an example.

The processor honors the project Twill/JSX settings. Generated-only diagnostics are suppressed. Fixes and suggestions are offered only when their ranges and replaced text map exactly to original source; fixes requiring compiler-generated syntax are withheld. disposeProjects() releases the cached typed projects when embedding the plugin in a long-lived process. The typed cache checks existing project/configuration file mtimes; restart linting after adding/deleting files to refresh discovered roots.

For VS Code, use Microsoft's ESLint extension and add twill-typescript and twill-tsx to eslint.validate. The Twill VSIX supplies language IDs and TypeScript diagnostics; ESLint supplies lint rules and fixes.

Custom rule overrides should also match the virtual TS/TSX files, as with other ESLint processors:

{ files: ['**/*.{ts,tsx,twill,twillx}'], rules: { 'prefer-const': 'error' } }

Framework ESLint plugins can attach their ordinary TS/TSX rules to these virtual files. Keep ESLint formatting rules disabled and let Prettier handle layout; rewrites spanning generated syntax cannot always be mapped back safely.

Documentation · Issues · MIT licensed · Built by forth.ink.

Added in 0.2.0

Twill 0.2.0 adds if const value = lookup() { use(value); } with branch-local nullish bindings and native destructuring. Group trailing calls in initializers, following Swift’s condition boundary. It emits native branches without a helper, closure or optional wrapper. See syntax and RFC 0018.

Twill 0.2.0 includes associated-value enums and match expressions: match (state) { case State.loaded({ value }): value; default: 0; }. Named payload bindings and erased factory descriptors compile to native switches without calling factories. Native switch statements retain JS fallthrough; match and switch expressions return one result without fallthrough. Use the coordinated 0.2.0 packages and extension. Compiler, formatter, linter, highlighter, export and editor changes are validated together. See syntax and compatibility and RFC 0016.

Development

This package's implementation uses Twill and emits ordinary JavaScript. Build and check a checkout with the workspace tools; see developing tooling in Twill for bootstrap and contribution instructions.