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 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-ts-patch-bun

v8.57.0-0

Published

Support eslint.config.mjs and eslint.config.ts for ESLint using Bun

Downloads

12

Readme

eslint-ts-patch-bun

npm version npm downloads bundle JSDocs License

Support loading eslint.config.mjs or eslint.config.ts as flat config file for ESLint.

Configure files will be searched in the following order, the first one found will be used:

  • eslint.config.js
  • eslint.config.mjs
  • eslint.config.cjs
  • eslint.config.ts
  • eslint.config.mts
  • eslint.config.cts

All these config files are loaded natively by Bun.

Context:

Install

bun add -D eslint-ts-patch-bun eslint@npm:eslint-ts-patch-bun

It should make your eslint CLI work for those config files automatically. If it's still not, you can try switching the CLI to eslint-ts.

Compatibility

Tested with the following tools:

Package Managers

  • bun

Integrations

  • eslint CLI ✅
  • VSCode ESLint extension ✅ (as it's executing your local node_modules/.bin/eslint)

Haven't gotten chance to test with other integrations, contributions are welcome.

Versioning

This package proxies all ESLint exports, it should be compatible by aliasing the eslint package. The version of this package is the same as the latest supported ESLint version in addition to a patch number suffix indicating the patches of this package (e.g. 8.55.0-1). It's using ^ relaxed dependency of eslint, so it should work with any newer versions of ESLint.

How it works

As the support of eslint.config.js seems to be quite hard-coded in ESLint, this package proxies all exports of ESLint and installs this register beforehand. The register will swap some internal code of ESLint at runtime to make it work.

Disclaimer

It's only recommended to install this as top-level development dependency (user-aware). For plugin and library authors, it's ok to document the usage of this package for better DX. But we suggest avoiding having this as the dependency of your library or plugin, otherwise, take your own risk.

Troubleshooting

Is the Patch Working

This patch is designed to be as transparent as possible. If you want to verify if it's working, you can add DEBUG="eslint-ts-patch-bun" environment variable to your command to see the debug logs.

➜ DEBUG="eslint-ts-patch-bun" bunx --bun eslint -v

  eslint-ts-patch initialized +0ms
  eslint-ts-patch patched lib/eslint/flat-eslint.js +59ms

v8.55.0

Sponsors

License

MIT License © 2023-PRESENT Anthony Fu