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

js-style-kit

v0.8.9

Published

A zero configuration style guide for ESLint and Prettier

Readme

js-style-kit

A zero-configuration style guide for ESLint and Prettier that provides sensible default settings and flexible configuration options.

CI Release npm version License: MIT codecov

Features

  • Batteries included - ESLint, Prettier, and all plugins bundled (no peer dependency headaches)
  • ESLint v9 flat config format
  • TypeScript first with automatic project detection
  • Framework support - React, Next.js, Vite, Remix, React Router
  • Auto-sorting - Imports, objects, properties, and more
  • Smart defaults - All rules configured as warnings (not errors)
  • Highly configurable - Enable only what you need, what you don't use is left out of the config for efficiency
  • ESM-only - For modern JavaScript projects

Requirements

  • Node.js v20.11.0 or higher

Installation

npm install js-style-kit --save-dev
# or
yarn add js-style-kit --dev
# or
pnpm add js-style-kit --save-dev
# or
bun add js-style-kit --dev

Quick Start

Option 1: CLI (Recommended)

The fastest way to get started is with our CLI tool:

npx js-style-kit init

This will:

  1. Install dependencies
  2. Create style-kit.config.js, eslint.config.js, and prettier.config.js
  3. Add npm scripts to your package.json
  4. Configure VS Code settings

→ Learn more about the CLI

Option 2: Manual Setup

ESLint

Create eslint.config.js (or eslint.config.mjs if not using "type": "module"):

// @ts-check
import { eslintConfig } from "js-style-kit";

export default eslintConfig();

Add scripts to package.json:

{
  "scripts": {
    "lint": "eslint . --max-warnings=0 --cache",
    "lint:fix": "eslint . --fix --max-warnings=0 --cache"
  }
}

Note: The --max-warnings=0 flag is important since all rules are warnings by default.

Prettier

Create prettier.config.js (or prettier.config.mjs if not using "type": "module"):

// @ts-check
import { prettierConfig } from "js-style-kit";

export default prettierConfig();

Add scripts to package.json:

{
  "scripts": {
    "format": "prettier . --write --cache",
    "format:check": "prettier . --check --cache"
  }
}

Tip: For faster formatting, you can add the --experimental-cli flag to your format commands (e.g., prettier . --write --cache --experimental-cli). This uses Prettier's experimental CLI which can provide significant performance improvements. If you experience any issues, simply remove the flag.

Configuration

ESLint Options

import { eslintConfig } from "js-style-kit";

export default eslintConfig(
  {
    // Core options
    typescript: true, // Boolean or path to tsconfig.json
    react: false, // React support (see React config docs)
    functionStyle: "arrow", // "arrow" | "declaration" | "expression" | "off"

    // Plugin toggles
    importPlugin: true, // Import/export validation
    sorting: true, // Auto-sort imports, objects, etc.
    unicorn: true, // Enforce file naming and best practices
    // or configure filename case:
    // unicorn: { filenameCase: "kebabCase" }, // "camelCase" | "kebabCase" | "pascalCase" | "snakeCase"
    jsdoc: { requireJsdoc: false }, // JSDoc validation

    // Framework & tools
    query: false, // TanStack Query rules
    testing: { framework: "vitest" }, // Test framework config
    storybook: false, // Storybook rules
    turbo: false, // Turborepo rules
    convex: false, // Convex backend rules

    // Advanced
    ignores: [], // Additional ignore patterns
    rules: {}, // Custom rule overrides
  },
  // Additional ESLint config objects
  {
    name: "custom-globals",
    languageOptions: {
      globals: {
        process: "readonly",
      },
    },
  },
);

Configuration Guides

Each configuration has detailed documentation:

Prettier Options

import { prettierConfig } from "js-style-kit";

export default prettierConfig({
  // Plugin options
  cssOrderPlugin: true, // Sort CSS properties
  curlyPlugin: true, // Enforce curly braces
  jsonSortPlugin: true, // Sort JSON keys
  packageJsonPlugin: true, // Sort package.json
  tailwindPlugin: false, // Boolean, path to global css file, or config object
  parser: "oxc", // "oxc" (faster) or "default"

  // Standard Prettier options
  printWidth: 80,
  tabWidth: 2,
  // ... any Prettier option
});

→ Full Prettier documentation

Framework Examples

React with Next.js

import { eslintConfig } from "js-style-kit";

export default eslintConfig({
  typescript: "./tsconfig.json",
  react: {
    framework: "next",
    reactCompiler: true, // React 19 compiler rules (enabled by default)
  },
  testing: {
    framework: "vitest",
    itOrTest: "it",
  },
});

React with Vite

import { eslintConfig } from "js-style-kit";

export default eslintConfig({
  react: {
    framework: "vite",
    reactRefresh: true, // Fast Refresh validation (enabled by default with vite)
  },
  testing: { framework: "vitest" },
});

TypeScript Library

import { eslintConfig } from "js-style-kit";

export default eslintConfig({
  typescript: "./tsconfig.json",
  jsdoc: { requireJsdoc: true }, // Enforce JSDoc for public APIs
  testing: { framework: "bun" },
});

Adding Custom Rules

You can override any rule or add custom configurations. If you disable a rule in the rules object, it will be removed from the config for efficiency.

import { eslintConfig } from "js-style-kit";

export default eslintConfig(
  {
    typescript: true,
    react: true,
    rules: {
      // Override built-in rules
      "no-console": ["error", { allow: ["warn", "error"] }],
      "@typescript-eslint/no-explicit-any": "off",
    },
  },
  // Additional ESLint config objects
  {
    name: "custom-globals",
    languageOptions: {
      globals: {
        process: "readonly",
      },
    },
  },
);

What's Included

ESLint Plugins

Prettier Plugins

License

MIT


Note: This is a work in progress. Please open an issue if you have suggestions or find any problems!