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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@prefer-jsr/eslint-plugin-prefer-jsr

v0.3.4

Published

ESLint plugin that suggests using JSR packages over NPM when available

Readme

@prefer-jsr/eslint-plugin-prefer-jsr

An ESLint plugin that suggests using JSR packages over NPM when available.

Installation

pnpm i jsr:@prefer-jsr/eslint-plugin-prefer-jsr
yarn add jsr:@prefer-jsr/eslint-plugin-prefer-jsr
npx jsr add @prefer-jsr/eslint-plugin-prefer-jsr
npm install --save-dev @prefer-jsr/eslint-plugin-prefer-jsr

With new ESLint JSON language feature (recommended)

pnpm i jsr:@eslint/json
yarn add jsr:@eslint/json
npx jsr add @eslint/json
npm install --save-dev @eslint/json

With the legacy JSON parser

pnpm add -D jsonc-eslint-parser
yarn add -D jsonc-eslint-parser
npm install --save-dev jsonc-eslint-parser

Usage

This plugin works with package.json files and supports both the new @eslint/json parser and the legacy jsonc-eslint-parser.

Recommended Config

One way to use this plugin is with the recommended config:

// eslint.config.js
import { defineConfig } from 'eslint/config';
import preferJsr from '@prefer-jsr/eslint-plugin-prefer-jsr';
import json from '@eslint/json';

export default defineConfig([
  {
    plugins: {
      preferJsr,
      json,
    },
    extends: ['prefer-jsr/recommended'],
  },
]);

The recommended config automatically:

  • Applies to **/package.json files
  • Enables the @prefer-jsr/prefer-jsr rule with error severity

Flat Config (ESLint 9+) with @eslint/json

For more control, you can configure the plugin manually:

// eslint.config.js
import preferJsr from '@prefer-jsr/eslint-plugin-prefer-jsr';
import json from '@eslint/json';

export default [
  {
    files: ['package.json'],
    language: 'json/json',
    plugins: {
      '@prefer-jsr': preferJsr,
      json,
    },
    rules: {
      '@prefer-jsr/prefer-jsr': 'error',
    },
  },
];

Flat Config (ESLint 9+) with jsonc-eslint-parser (legacy)

// eslint.config.js
import preferJsr from '@prefer-jsr/eslint-plugin-prefer-jsr';
import jsoncParser from 'jsonc-eslint-parser';

export default [
  {
    files: ['package.json'],
    languageOptions: {
      parser: jsoncParser,
    },
    plugins: {
      '@prefer-jsr': preferJsr,
    },
    rules: {
      '@prefer-jsr/prefer-jsr': 'error',
    },
  },
];

Rules

prefer-jsr

This rule warns when a dependency in package.json has a JSR equivalent available.

example mappings:

  • zod@zod/zod
  • @eslint/markdown@eslint/markdown

Configuration

The rule accepts an options object with the following properties:

  • ignore (array): List of package names to ignore

Examples

Basic usage:

{
  rules: {
    '@prefer-jsr/prefer-jsr': 'error',
  },
}

Ignoring specific packages:

{
  rules: {
    '@prefer-jsr/prefer-jsr': ['error', {
      ignore: ['legacy-package', 'special-case']
    }],
  },
}

Valid

{
  "dependencies": {
    "@zod/zod": "jsr:^4.1.12"
  }
}

Invalid

{
  "dependencies": {
    "zod": "^4.1.12"
  }
}

Auto-fix available: The rule can automatically replace NPM dependencies with their JSR equivalents.

Features

  • 🔍 Detection: Identifies NPM dependencies that have JSR equivalents
  • 🔧 Auto-fix: Automatically replaces NPM imports with JSR versions
  • 📦 Package.json support: Works with all dependency types (dependencies, devDependencies, peerDependencies, optionalDependencies)
  • 🎯 Modern: Uses @eslint/json for proper JSON language support

Dependencies

This plugin specifically supports JSR packages that have been identified as having NPM equivalents. The mapping is maintained in the plugin and can be extended over time.

Contributing

Building

Run nx build eslint-plugin to build the library.

Running unit tests

Run nx test eslint-plugin to execute the unit tests via Vitest.