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

@hardlydifficult/ts-config

v0.0.10

Published

Opinionated ESLint, Prettier, and TypeScript config package with Next.js support.

Readme

@hardlydifficult/ts-config

Opinionated ESLint, Prettier, and TypeScript config package with Next.js support.

Installation

npm install @hardlydifficult/ts-config

Quick Start

// .eslintrc.cjs
import createConfig from "@hardlydifficult/ts-config/eslint";
import createNextConfig from "@hardlydifficult/ts-config/eslint-next";
import prettierConfig from "@hardlydifficult/ts-config/prettier";

export default [
  ...createConfig(__dirname),
  // For Next.js projects:
  // ...createNextConfig(__dirname, [
  //   ...nextConfig,
  // ]),
];
// .prettierrc.json
{
  "semi": true,
  "singleQuote": false,
  "tabWidth": 2,
  "useTabs": false,
  "trailingComma": "es5",
  "bracketSpacing": true,
  "bracketSameLine": false,
  "arrowParens": "always",
  "endOfLine": "lf",
  "printWidth": 80,
  "quoteProps": "as-needed",
  "jsxSingleQuote": false,
  "proseWrap": "preserve",
  "htmlWhitespaceSensitivity": "css",
  "embeddedLanguageFormatting": "auto",
  "singleAttributePerLine": false
}

ESLint Configurations

Base ESLint Config

The shared ESLint flat config provides strict type-checking, import ordering, JSDoc, and code style rules for TypeScript projects.

import createConfig from "@hardlydifficult/ts-config/eslint";
import type { Linter } from "eslint";

const config: Linter.Config[] = createConfig("path/to/project/root");

Key Features:

  • TypeScript strict type-checking via typescript-eslint
  • Import ordering with eslint-plugin-import-x
  • JSDoc enforcement on exported symbols via eslint-plugin-jsdoc
  • Unused import removal via eslint-plugin-unused-imports
  • Code style enforcement (e.g., prefer-const, no-var, curly: "all")

Ignores:

  • **/dist/**
  • **/node_modules/**
  • **/*.js
  • **/tests/**
  • **/vitest.config.ts
  • **/.next/**
  • **/.turbo/**
  • **/*.config.mjs

Next.js ESLint Config

For Next.js projects, combine the base config with Next-specific rules.

import createNextConfig from "@hardlydifficult/ts-config/eslint-next";
import type { Linter } from "eslint";
import nextConfig from "./next.config.js";

const config: Linter.Config[] = createNextConfig(__dirname, [
  ...(nextConfig as Linter.Config[]),
]);

Next-specific rules:

  • Disables React scope rule (react/react-in-jsx-scope: "off")
  • Disables prop-types (react/prop-types: "off")
  • Enforces self-closing components for components and HTML
  • Enforces consistent JSX boolean value style (never)
  • Warns on array index keys
  • Enforces JSX curly brace presence (props: "never", children: "never")

Prettier Configuration

Prettier code formatting configuration for TypeScript/JavaScript projects.

import prettierConfig from "@hardlydifficult/ts-config/prettier";

export default prettierConfig;

| Option | Value | |-----------------------------|--------------------------| | semi | true | | singleQuote | false | | tabWidth | 2 | | useTabs | false | | trailingComma | "es5" | | bracketSpacing | true | | bracketSameLine | false | | arrowParens | "always" | | endOfLine | "lf" | | printWidth | 80 | | quoteProps | "as-needed" | | jsxSingleQuote | false | | proseWrap | "preserve" | | htmlWhitespaceSensitivity | "css" | | embeddedLanguageFormatting| "auto" | | singleAttributePerLine | false |

TypeScript Configuration

Base tsconfig

Provides strict settings and modern ES2022 features for consistent builds across the project.

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "CommonJS",
    "moduleResolution": "node",
    "lib": ["ES2022"],
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "resolveJsonModule": true,
    "isolatedModules": true
  }
}

Project tsconfig

Base TypeScript configuration for Node.js projects.

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "Node16",
    "moduleResolution": "node16",
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  },
  "include": ["src/**/*"]
}

API Reference

| Export | Type | Description | |------------------------|-------------------|-------------------------------------------------------| | eslint | function | Creates the shared ESLint config for TypeScript | | eslint-next | function | Creates ESLint config for Next.js projects | | prettier | object | Prettier configuration object | | tsconfig.base.json | string (path) | Base TypeScript configuration (copied to output dir) |