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-strict-code

v1.1.1

Published

Strict ESLint rules for clean code: no path aliasing, no complex conditionals, no destructuring, strict naming, and more.

Readme

eslint-plugin-strict-code

Strict ESLint rules for clean code: no path aliasing, no complex conditionals, no destructuring, strict naming, and more.

Installation

npm install --save-dev eslint-plugin-strict-code

Usage

Flat config (ESLint 9+)

// eslint.config.js
import strictCode from "eslint-plugin-strict-code";

export default [
  {
    plugins: { "strict-code": strictCode },
    rules: {
      "strict-code/no-path-aliasing": "error",
      "strict-code/no-complex-conditionals": "error",
      "strict-code/no-fn-on-expression": "error",
      "strict-code/strict-naming": "error",
      "strict-code/no-complex-arguments": "error",
      "strict-code/no-destructuring": "error",
      "strict-code/no-unassigned-call": "error",
      "strict-code/prefer-signals-no-input": "error",
      "strict-code/prefer-takeuntil-destroyed": "error",
      "strict-code/no-complex-return": "error",
      "strict-code/no-complex-assignment": "error",
      "strict-code/no-redundant-type-annotation": "error",
      "strict-code/prefer-typeof": "warn",
    },
  },
];

Extends (ESLint 9.19+)

The plugin ships a recommended config that enables the core rule no-negated-condition (if (!x) ... else ...). Use defineConfig from eslint/configextends in flat config requires it, and the plugin must be registered in the same config object.

// eslint.config.js
import { defineConfig } from "eslint/config";
import strictCode from "eslint-plugin-strict-code";

export default defineConfig([
  {
    plugins: { "strict-code": strictCode },
    extends: ["strict-code/recommended"],
    // + ваши индивидуальные правила strict-code/* из Flat config
  },
]);

Legacy eslintrc (ESLint 8)

The plugin ships a legacy-recommended config — the full overrides set (typescript + Angular templates) ported from web-frontend-dev's .eslintrc.json:

{
  "root": true,
  "extends": ["plugin:strict-code/legacy-recommended"]
}

It requires these plugins installed in the consumer project: @typescript-eslint/eslint-plugin + @typescript-eslint/parser, @angular-eslint/eslint-plugin, eslint-plugin-unused-imports, @stylistic/eslint-plugin, eslint-plugin-sonarjs, eslint-plugin-prettier, prettier. parserOptions.project is resolved relative to the consumer's working directory (same as before the move).

ESLintrc (legacy)

{
  "plugins": ["strict-code"],
  "rules": {
    "strict-code/no-path-aliasing": "error",
    "strict-code/no-complex-conditionals": "error",
    "strict-code/no-fn-on-expression": "error",
    "strict-code/strict-naming": "error",
    "strict-code/no-complex-arguments": "error",
    "strict-code/no-destructuring": "error",
    "strict-code/no-effect-outside-component": "error",
    "strict-code/no-unassigned-call": "error",
    "strict-code/prefer-signals-no-input": "error",
    "strict-code/prefer-takeuntil-destroyed": "error",
    "strict-code/no-complex-return": "error",
    "strict-code/no-complex-assignment": "error",
    "strict-code/no-redundant-type-annotation": "error",
    "strict-code/prefer-typeof": "warn"
  }
}

Rules

| Rule | Description | | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | | no-path-aliasing | Path aliasing is forbidden for lines <= 100 chars | | no-complex-conditionals | No index access, type assertions, or ternary in conditionals | | no-fn-on-expression | Function calls on non-simple expressions are forbidden | | strict-naming | iter prefix for loop variables | | no-complex-arguments | Binary/logical/conditional expressions forbidden as arguments | | no-complex-assignment | No call/index access/type assertion combined with operators in assignments | | no-destructuring | Object destructuring is forbidden | | no-effect-outside-component | Angular: effect()/untracked() only in .component.ts/.directive.ts/.spec.ts files, inside class methods (not constructors/lifecycle hooks) | | no-unassigned-call | Call results must be assigned before use | | no-complex-return | Complex return expressions are forbidden | | no-redundant-type-annotation | Redundant type annotations are forbidden | | prefer-typeof | Prefer typeof varName over duplicated types | | no-form-control-name | Angular: formControlName is forbidden (requires @angular-eslint/utils) | | prefer-signals-no-input | Angular: prefer signals over @Input decorator | | prefer-takeuntil-destroyed | Angular: subscribe() must use takeUntilDestroyed() or takeUntil() in @Component/@Directive |

License

MIT © Sergey