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

eslint-plugin-sprinkles-prefer

v2.1.1

Published

ESLint plugin to prefer sprinkles over vanilla-extract style. Dynamically parses your project's sprinkles.css.ts file.

Readme

eslint-plugin-sprinkles-prefer

ESLint plugin to prefer sprinkles over vanilla-extract style for supported properties. This plugin dynamically analyzes your project's sprinkles.css.ts file to understand which properties should use sprinkles.

Features

  • Dynamic Analysis: Automatically finds and parses your project's sprinkles.css.ts file
  • Auto-fix: Provides automatic fixes to transform code to use sprinkles
  • Preserves Context: Maintains other style variables and complex expressions in style arrays
  • Comprehensive Support: Works with style(), styleVariants(), and recipe() patterns
  • Smart Detection: Only suggests changes for properties actually defined in your sprinkles

Installation

npm install --save-dev eslint-plugin-sprinkles-prefer
# or
yarn add -D eslint-plugin-sprinkles-prefer

Configuration

ESLint Flat Config (eslint.config.js)

import sprinklesPrefer from 'eslint-plugin-sprinkles-prefer';

export default [
  {
    plugins: {
      'sprinkles-prefer': sprinklesPrefer
    },
    rules: {
      'sprinkles-prefer/prefer-sprinkles': 'warn'
    }
  }
];

Or use the recommended config:

import sprinklesPrefer from 'eslint-plugin-sprinkles-prefer';

export default [
  sprinklesPrefer.configs['flat/recommended']
];

Legacy Config (.eslintrc)

Add to your ESLint config:

{
  "plugins": ["sprinkles-prefer"],
  "rules": {
    "sprinkles-prefer/prefer-sprinkles": "warn"
  }
}

Or use the recommended config:

{
  "extends": ["plugin:sprinkles-prefer/recommended"]
}

How It Works

The plugin automatically searches for your sprinkles.css.ts file in common locations:

  • **/sprinkles.css.ts
  • **/src/style/sprinkles.css.ts
  • **/src/styles/sprinkles.css.ts
  • And other common patterns

It then parses the defineProperties calls to understand which CSS properties and values are available through sprinkles.

Examples

Basic transformation:

// Before
const myStyle = style({
  display: 'flex',
  flexDirection: 'column',
  padding: '16px',
});

// After (auto-fixed)
const myStyle = style([
  sprinkles({
    display: 'flex',
    flexDirection: 'column',
  }),
  {
    padding: '16px',
  }
]);

Preserves other style variables:

// Before
const combined = style([
  baseStyle,
  {
    display: 'flex',
    gap: 12,
  }
]);

// After (auto-fixed)
const combined = style([
  baseStyle,
  sprinkles({
    display: 'flex',
  }),
  {
    gap: 12,
  }
]);

Works with styleVariants:

// Before
export const variants = styleVariants({
  primary: {
    backgroundColor: 'blue-500',
    padding: '8px',
  }
});

// After (auto-fixed)
export const variants = styleVariants({
  primary: style([
    sprinkles({
      backgroundColor: 'blue-500',
    }),
    {
      padding: '8px',
    }
  ])
});

Supported Properties

The plugin supports all properties defined in your project's sprinkles configuration. Common examples include:

  • Layout: display, position, flexDirection, justifyContent, alignItems
  • Sizing: width, height, margin
  • Typography: textAlign, whiteSpace, wordBreak
  • Visual: overflow, borderRadius
  • Colors: color, backgroundColor (with theme tokens)
  • Z-index: Named constants like MODAL, STICKY, etc.

Requirements

  • Node.js >= 14.0.0
  • ESLint >= 7.0.0
  • A vanilla-extract project with sprinkles configured

License

MIT