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

pretty-linter

v1.0.5

Published

A script to setup prettier & eslint in your project

Downloads

68

Readme


🚀 pretty-linter

A simple CLI tool to quickly set up Prettier in your project with sensible defaults.


📌 Features

  • Automatically configures Prettier with recommended settings.
  • Sets up a .prettierrc.json file.
  • Creates a .prettierignore file.
  • Adds a format script in package.json for easy formatting.
  • Supports formatting modified files (Git tracked) or all files in a folder or specific file.
  • Automatically detects project type: next, react, vite, nest, or node.

🛠 Installation

Option 1: Run with npx (Recommended)

npx pretty-linter

Option 2: Install Globally

npm install -g pretty-linter

Then run:

pretty-linter

🚀 Usage

Run the setup command inside your project folder:

npx pretty-linter

You’ll be prompted with options to choose how you want to format files:

1️⃣  Format only modified & newly added files (Git)
2️⃣  Format all files under a folder or a file (you can specify path)
3️⃣  Format only newly added files (Git)

You can also run:

npm run format

Or pass a specific path:

npm run format -- [pathName]

📁 Framework Detection

This tool automatically detects the project type by reading your package.json. Supported types:

  • next → for Next.js projects
  • react → for React.js (e.g., CRA or Vite+React)
  • vite → for Vite-based apps
  • nest → for NestJS backend projects
  • node → plain Node.js or backend-only apps

⚙️ Configuration

Only if your project is React-based (Next.js, React, Vite), the following Prettier config will be applied:

{
  "semi": false,
  "singleQuote": true,
  "trailingComma": "es5",
  "printWidth": 80,
  "tabWidth": 2,
  "plugins": [
    "@trivago/prettier-plugin-sort-imports"
  ],
  "importOrder": [
    "^react(.*)",
    "^formik(.*)",
    "^redux(.*)",
    "^yup(.*)",
    "^dayjs(.*)",
    "@mui/(.*)",
    "@reduxjs/(.*)",
    "@/components/(.*)",
    "@/types/(.*)",
    "@/services/(.*)",
    "@/pages/(.*)",
    "@/app/(.*)",
    "@/features/(.*)",
    "@/utils/(.*)",
    "@/assets/(.*)",
    "@/(.*)",
    "@/(.scss)",
    "@/(.css)",
    "^[./]"
  ]
}

❗ Note:

If the project is Node.js or NestJS, the tool will not include @trivago/prettier-plugin-sort-imports or importOrder settings, since they're not usually relevant in backend-only codebases.


🗂 .prettierignore

These files/folders are ignored by default:

node_modules
dist
build
.next
coverage
*.log

✅ Added Script

Automatically added to package.json:

"scripts": {
  "format": "npx prettier --config .prettierrc.json --write"
}

Run with:

npm run format
# or format a custom folder or file
npm run format -- [pathname]
# example: npm run format -- src/home/index.jsx

🐛 Troubleshooting

  • Make sure Node.js is installed (node -v)

  • Clear any broken installations:

    rm -rf node_modules && npm install
  • For peer dependency issues:

    npm install --legacy-peer-deps