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

@lilian1315/oxlint-plugin-create-element

v0.1.0

Published

Oxlint rules for type-safe DOM JSX created by @lilian1315/create-element.

Readme

@lilian1315/oxlint-plugin-create-element

Oxlint rules for validating explicit DOM types used with @lilian1315/create-element JSX.

Default JSX creates DOM nodes, while /virtual JSX creates deferred VNodes. Both erase their intrinsic tag from the shared expression type. This plugin checks direct DOM assertions and explicit virtual build<'button'> tags against known JSX roots.

Installation

pnpm add -D @lilian1315/oxlint-plugin-create-element

Configuration

Add the plugin and rule to your Oxlint configuration (for example, .oxlintrc.json):

{
  "jsPlugins": ["@lilian1315/oxlint-plugin-create-element"],
  "rules": {
    "create-element/valid-jsx-type-assertion": "error"
  }
}

The rule validates build<'div'>(<div />) and direct assertions such as <div /> as HTMLDivElement. Mismatches are automatically fixable. For build, it also follows simple const references and aliases to intrinsic JSX roots, respecting lexical scope. Parentheses, as, satisfies, and non-null assertions do not hide the original root.

Explicit build tags must be string literals with a verifiable intrinsic JSX root. Mutable variables, parameters, imports, function results, components, and fragments cannot be verified and are reported without an automatic fix. Inline a matching intrinsic root, use a const initialized from one, or omit the generic.

Examples

/** @jsxImportSource @lilian1315/create-element/virtual */

import { build } from '@lilian1315/create-element/virtual/dom'
import type { JSX } from '@lilian1315/create-element/virtual/jsx-runtime'

// Valid: the explicit type matches the literal root.
const button = build<'button'>(<button>Save</button>)
const circle = build<'svg:circle'>(<svg:circle r={10} />)

// Invalid: the rule fixes the generic to 'button'.
const mismatch = build<'input'>(<button>Save</button>)

const tree = <span />
const alias = tree
const span = build<'span'>(alias) // Valid: the const root is known.
const wrong = build<'div'>(tree) // Invalid: fixes the generic to 'span'.

function render(tree: JSX.Element) {
  return build<'span'>(tree) // Invalid: the root cannot be verified.
}

The rule also checks SVG and MathML prefixes and direct JSX assertions. It does not add runtime validation or infer the rendered root of components. Prefer a matching intrinsic root for an explicit build tag generic; use mount to manage component or Fragment roots.

For a direct createVNode root from /virtual, build(createVNode('button', { children: 'Save' })) already infers HTMLButtonElement, so no explicit generic is needed.