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-stylish

v0.1.0

Published

CSS Eslint plugin

Readme

eslint-plugin-stylish

Tailwind in vanilla CSS.

ESLint rules for keeping atomic class names in JavaScript and CSS in sync. Reports unused CSS classes and suggests adding missing utility classes automatically.

Use Tailwind utility classes in JS/TS, run ESLint with --fix, and commit the generated utilities.css file. No Tailwind build step or other special CSS tooling is required.

Quick start

npm install --save-dev eslint @eslint/js @eslint/css eslint-plugin-stylish

Example eslint.config.js:

import css from "@eslint/css"
import js from "@eslint/js"
import { defineConfig } from "eslint/config"
import stylish from "eslint-plugin-stylish"

export default defineConfig([
  {
    files: ["**/*.{js,jsx,ts,tsx}"],
    extends: [js.configs.recommended, stylish.configs.js],
  },
  {
    files: ["**/*.css"],
    language: "css/css",
    extends: [css.configs.recommended, stylish.configs.css],
  },
])

This config will already warn about undeclared classes in JS and unused classes in CSS.

Additionally, you can create an empty utilities.css file and import it from your main CSS file, for example:

@layer base, components, utilities;

@import "./utilities.css" layer(utilities);

@layer base {
  /* Example reset styles (plugin doesn't add any) */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
  }
  :root {
    font-family: system-ui, sans-serif;
    line-height: 1.5;
  }
}

Then, use Tailwind classes in you JS files. For example, this JSX:

export function Card() {
  return <article className="flex gap-4 flex-col md:flex-row" />
}

will suggest an auto fix which adds the missing classes to utilities.css:

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-4 {
  gap: calc(var(--spacing) * 4);
}

.md\:flex-row {
  @media (width >= 48rem) {
    flex-direction: row;
  }
}

You can setup your editor to run ESLint autofix on save:

.zed/settings/json

{
  "code_actions_on_format": {
    "source.fixAll.eslint": true
  },
  "format_on_save": "on",
  "languages": {
    "CSS": {
      "language_servers": ["eslint"]
    }
  }
}

.vscode/settings.json

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },
  "eslint.validate": ["css"]
}

or run it manually:

npx eslint . --fix

Advantages over Tailwind CSS

  • No build step. The utility classes are part of the project source.
  • Easy customization. No need to tinker with non-standard Tailwind config format. If you don't like what Tailwind generates for a given utility class, you can simply change it in utilities.css after it's generated.
  • Simple to extend. No need to install custom Tailwind plugins as dependencies. You can simply add your own utility classes to utilities.css and they will be available to use in your project.

FAQ

Rules

stylish/no-undefined-class

Reports class names used in JavaScript that do not appear in any CSS file. It checks class-related properties such as className, class, classes, and classNames.

stylish/no-undefined-var

Reports undefined custom property references like var(--foo).

Unlike the built-in rule, it checks references across files. Add "css/no-invalid-properties": ["error", { allowUnknownVariables: true }] to your custom config or use this plugin's recommended config to disable the built-in check.

stylish/no-unused-class

Reports CSS class selectors that are not referenced in any JavaScript file. If it's a Tailwind class, it will automatically remove it with an autofix.

stylish/no-unused-var

Reports unused CSS custom properties.

stylish/no-missing-atom

Runs only on file named utilities.css. Finds supported utility classes used in project source files but missing from that file. With ESLint autofix, it suggests to add the corresponding CSS declarations.

TODOs

  • [ ] A rule which enforces a consistent order for utility classes.
  • [ ] A rule which checks CSS modules if you use those.