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

oxlint-plugin-react-use-propswithchildren

v1.0.0

Published

oxlint JS plugin: require components that use children to type their props via PropsWithChildren<Props>, and disallow declaring children explicitly inside Props

Readme

oxlint-plugin-react-use-propswithchildren

An oxlint JS plugin that requires components that use children to type their props via React's own PropsWithChildren<Props> generic, and disallows declaring children explicitly as a field inside Props. This is the oxlint counterpart of eslint-plugin-react-use-propswithchildren, for projects that lint with oxlint instead of ESLint.

Rule

react-use-propswithchildren/require-props-with-children

Same three directions as the ESLint package's rule of the same name:

  • Component uses children (destructured, or via props.children) but its props type isn't PropsWithChildren<Props> → missing PropsWithChildren.
  • Props type declares children explicitly as its own field → always flagged.
  • Props type is PropsWithChildren<Props> but children is never used → unnecessary.

Installation

npm install oxlint-plugin-react-use-propswithchildren --save-dev

Register it in .oxlintrc.json:

{
  "jsPlugins": [
    "./node_modules/oxlint-plugin-react-use-propswithchildren/index.js"
  ],
  "rules": {
    "react-use-propswithchildren/require-props-with-children": "error"
  }
}

Or copy .oxlintrc.json from this package as a starting point.

Compatibility

oxlint's JS plugin API (@oxlint/plugins' definePlugin/defineRule) is alpha and not covered by semver — expect breaking changes on oxlint upgrades. @oxlint/plugins and oxlint are versioned in lockstep (both tracked at the same ^1.x release here).

oxc parses .tsx natively and hands the JS plugin API a typescript-estree-compatible AST (same node names as @typescript-eslint), so utils.js here mirrors the ESLint package's AST-reading logic almost exactly — kept as a separate copy, not shared, since the two packages are published independently.

Limitations

Same as the ESLint package: a named type reference is resolved against local interface/type/PropsWithChildren<T> declarations in the same file; a type imported from elsewhere can't be resolved from a single file's AST, so the "explicit children in Props" check doesn't fire for it. oxlint's JS plugin API has no type-checker access at all (type-aware linting is native-Rust-only in oxlint), so there's no upgrade path for imported types here, unlike the ESLint package's optional type-aware mode.

children usage is detected as either a destructured { children } property, or a props.children member access when the parameter isn't destructured.

Local dev note: oxlint's native binding is an optional dependency (@oxlint/binding-darwin-arm64 etc.) that can fail to install due to a known npm bug (npm/cli#4828) even after a clean rm -rf node_modules package-lock.json && npm install — if oxlint --version throws "Cannot find native binding," install the platform package directly (e.g. npm install @oxlint/binding-darwin-arm64@<version> --save-optional).

Testing

npm test

Runs the local oxlint binary (--format=json) against the fixture in test/fixtures/ (test/run.js), asserting diagnostics land on exactly the expected lines.