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-th-rules

v3.6.1

Published

A List of custom ESLint rules created by Tomer Horowitz

Readme

eslint-plugin-th-rules

semantic-release XO code style Snyk Security CodeQL OpenSSF Scorecard

A set of custom ESLint rules designed to improve code quality, enforce consistency, and introduce development conventions across TypeScript, React, and JavaScript projects.

This plugin provides:

  • Custom rules unique to this repository
  • Recommended flat configs that bundle th-rules with popular third-party plugins
  • Advanced composable config layers for consumers who want fine-grained control

Installation

npm install --save-dev eslint-plugin-th-rules

or

yarn add -D eslint-plugin-th-rules

This plugin requires ESLint Flat Config (ESLint 8.21+).


Usage

The plugin exposes three public recommended configurations.

These are the presets most users should consume.

Recommended (Full Opinionated)

Includes:

  • All th-rules
  • External plugins (lodash, n, sonarjs, security)
  • Opinionated rule settings for externals
// eslint.config.js
import thRules from "eslint-plugin-th-rules";

export default [
  ...thRules.configs.recommended
];

Recommended + TypeScript

Recommended plus full strict/stylistic TypeScript configurations.

import thRules from "eslint-plugin-th-rules";

export default [
  ...thRules.configs.recommendedTypescript
];

Recommended + React

Recommended plus:

  • eslint-plugin-react
  • eslint-plugin-react-hooks
  • JSX Runtime rules
import thRules from "eslint-plugin-th-rules";

export default [
  ...thRules.configs.recommendedReact
];

Recommended + TypeScript + React

Recommended plus TypeScript and React extensions.

import thRules from "eslint-plugin-th-rules";

export default [
  ...thRules.configs.recommendedTypescriptReact
];

Advanced Composition (Optional)

If you want total control, you may import internal composition layers.

These layers are intentionally not included in configs, because they are not presets but building blocks.

import {
  coreBase,
  externalsBase,
  externalsOpinionated,
  coreTypescript,
  coreReact
} from "eslint-plugin-th-rules";

Only use th-rules

export default [
  ...coreBase
];

Add external plugins (unstyled)

export default [
  ...coreBase,
  ...externalsBase
];

Add external plugins + th-rules opinions

export default [
  ...coreBase,
  ...externalsBase,
  ...externalsOpinionated
];

Add TypeScript or React extensions

export default [
  ...coreBase,
  ...externalsBase,
  ...externalsOpinionated,
  ...coreTypescript,
  ...coreReact
];

Auto-Generated Rule Documentation

The following section is generated via eslint-doc-generator.
Do not edit below this line.

Rules

💼 Configurations enabled in.
✅ Set in the recommended configuration.
⚛️ Set in the recommendedReact configuration.
🟦 Set in the recommendedTypescript configuration.
🎲 Set in the recommendedTypescriptReact configuration.
🔧 Automatically fixable by the --fix CLI option.

| Name                             | Description | 💼 | 🔧 | | :--------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------- | :- | | no-boolean-coercion | Disallow Boolean(value) or !!value. Enforce explicit checks: !.isNil(value) for scalars and !.isEmpty(value) for strings, arrays, and objects. If the value is already boolean, remove coercion. | ✅ ⚛️ 🟦 🎲 | 🔧 | | no-comments | Disallow comments except for specified allowed patterns. | ✅ ⚛️ 🟦 🎲 | 🔧 | | no-default-export | Convert unnamed default exports to named default exports based on the file name. | ✅ ⚛️ 🟦 🎲 | 🔧 | | no-destructuring | Disallow destructuring that does not meet certain conditions. | ✅ ⚛️ 🟦 🎲 | | | no-explicit-nil-compare | Disallow direct comparisons to null or undefined. Use _.isNull(x) / _.isUndefined(x) instead. | ✅ ⚛️ 🟦 🎲 | 🔧 | | no-isnil-isempty-on-boolean | Disallow _.isNil(...) / _.isEmpty(...) when the argument type is boolean or a union containing boolean (e.g., boolean | undefined, boolean | X). | ✅ ⚛️ 🟦 🎲 | | | prefer-explicit-nil-check | Disallow implicit truthy/falsy checks in boolean-test positions. Prefer explicit _.isNil(value) or _.isEmpty(value) (depending on the value type). | ✅ ⚛️ 🟦 🎲 | 🔧 | | prefer-is-empty | Require _.isEmpty instead of length comparisons or boolean checks on .length. | ✅ ⚛️ 🟦 🎲 | 🔧 | | prefer-lodash-iteratee-shorthand | Prefer Lodash iteratee shorthands. Example: _.find(collection, (x) => x.Y === z) -> _.find(collection, {Y: z}). Also prefers property shorthands like _.map(collection, (x) => _.get(x, path)) -> _.map(collection, path). | ✅ ⚛️ 🟦 🎲 | 🔧 | | schemas-in-schemas-file | Require Zod schema declarations to be placed in a .schemas.ts file. | ✅ ⚛️ 🟦 🎲 | | | top-level-functions | Require all top-level functions to be named regular functions. | ✅ ⚛️ 🟦 🎲 | 🔧 | | types-in-dts | Require TypeScript type declarations (type/interface/enum) to be placed in .d.ts files. | ✅ ⚛️ 🟦 🎲 | |


License

MIT