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

@jackjakarta/prettier-config

v0.3.2

Published

A modern, type-safe Prettier configuration with intelligent import sorting and customizable options

Readme

@jackjakarta/prettier-config

A modern, type-safe Prettier configuration with intelligent import sorting and customizable options.

Features

  • 📦 Smart import sorting - Automatic import organization with @ianvs/prettier-plugin-sort-imports
  • 🔧 Fully configurable - Customize import order, scopes, and aliases with TypeScript support
  • 🚀 Zero config - Works out of the box with minimal setup
  • 📝 TypeScript-first - Full type safety and IntelliSense
  • 🎨 Tailwind CSS support - Built-in integration with prettier-plugin-tailwindcss
  • 📋 Package.json formatting - Sorting and formatting of package.json with prettier-plugin-packagejson
  • 🏗️ Presets included - Ready-to-use configurations for Next.js, and more

Installation

# npm
npm install -D @jackjakarta/prettier-config

# pnpm (recommended)
pnpm add -D @jackjakarta/prettier-config

# yarn
yarn add -D @jackjakarta/prettier-config

Newer versions of PNPM starting pnpm@^10.0.0 will not automatically install dependencies or peer dependencies so you have manually install the plugins as well as prettier@^3.0.0.

pnpm add -D prettier @ianvs/prettier-plugin-sort-imports prettier-plugin-tailwindcss prettier-plugin-packagejson

Quick Start

Basic Usage

Create a prettier.config.js file in your project root:

import defineConfig from '@jackjakarta/prettier-config';

// Default config with no plugins enabled
export default defineConfig();

Using Presets

import defineConfig, { presets } from '@jackjakarta/prettier-config';

// No options (default values)
export default defineConfig(presets.nextjs())  // Next.js with Tailwind
export default defineConfig(presets.nodejs())  // Typical node project (No Tailwind)

// Customizable
export default defineConfig(presets.nextjs({
  order: {
    enabled: true,
    alias: ['@', '~', '#'],
  },
  tailwind: false,
}));

export default defineConfig(presets.nodejs({
  packageJson: true,
  extend: {
    printWidth: 140,
  }
}));

Custom Configuration

import defineConfig from '@jackjakarta/prettier-config';

export default defineConfig({
  order: {
    enabled: true,
    scope: ['components', 'hooks', 'utils', 'lib'],
    alias: ['@', '~', '#'],
  },
  tailwind: true,
  packageJson: true,
  extend: {
    printWidth: 120,
    semi: false,
    plugins: ['prettier-plugin-organize-attributes'], // Add additional plugins
  },
});

Options

order

Configure import sorting behavior:

  • enabled (boolean, default: true) - Enable/disable import sorting
  • scope (string | string[], default: []) - Internal scopes for import organization
  • alias (string[], default: []) - Path aliases used in your project

extend

Extend or override any Prettier configuration option.

tailwind

(boolean, default: false) - Enable Tailwind CSS class sorting

packageJson

(boolean, default: false) - Enable package.json formatting

Default Configuration

{
  printWidth: 100,
  tabWidth: 2,
  useTabs: false,
  semi: true,
  singleQuote: true,
  quoteProps: "as-needed",
  jsxSingleQuote: false,
  trailingComma: "all",
  bracketSpacing: true,
  bracketSameLine: false,
  arrowParens: "always",
  requirePragma: false,
  insertPragma: false,
  proseWrap: "preserve",
  htmlWhitespaceSensitivity: "strict",
  endOfLine: "lf",
  embeddedLanguageFormatting: "off",
}

Import Order

When import sorting is enabled, imports are organized in the following order:

  1. Built-in Node.js modules
  2. Third-party packages
  3. Path aliases (configured via alias option)
  4. Internal scopes (configured via scope option)
  5. Relative imports
  6. CSS imports (always last)

Usage Examples

React Project with Tailwind

// prettier.config.js
import defineConfig from '@jackjakarta/prettier-config';

export default defineConfig({
  order: {
    enabled: true,
    scope: ['components', 'hooks', 'utils', 'types'],
    alias: ['@', '~'],
  },
  tailwind: true,
  extend: {
    plugins: ['prettier-plugin-organize-attributes']
  },
});

Monorepo Setup

// prettier.config.js
import defineConfig from '@jackjakarta/prettier-config';

export default defineConfig({
  order: {
    enabled: true,
    scope: ['packages', 'apps', 'libs'],
    alias: ['@workspace', '@shared'],
  },
  extend: {
    printWidth: 120,
  },
});

You can see more examples here.

Package.json Scripts

Add these scripts to your package.json:

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

Editor Integration

VS Code

Install the Prettier extension and add to your settings:

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true  // optional
}

Peer Dependencies

This package requires Prettier 3.0.0 or higher:

{
  "peerDependencies": {
    "prettier": "^3.0.0"
  }
}

Contributing

Issues and pull requests are welcome!