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-stoic-angular

v1.0.0

Published

ESLint plugin that imposes strict design constraints on Angular code, with rules drawn from Five Lines of Code

Readme

eslint-plugin-stoic-angular

An ESLint plugin that imposes strict design constraints on Angular projects through lint checks. Many of the rules come from the rules in the book Five Lines of Code by Christian Clausen. This project is not affiliated with or endorsed by the book or its author.

Installation

pnpm add -D eslint-plugin-stoic-angular

The package has not been published to npm yet.

It requires ESLint 10 (eslint@^10.0.0).

Usage

ESLint

The plugin has no preset config objects (no configs). It has two functions that return a flat config, and you pick the one that fits how you adopt the rules:

  • defaults(overrides?) enables every rule at once, plugin rules and the core rules alike, with the default options. Use it to adopt the whole discipline and then change or remove what does not fit.
  • configure(settings) enables only the rules you list. Use it to adopt the rules one by one, so that every constraint in your project is one you chose.

Both register the plugin, and the severity is always error. A key is a rule name without the stoic-angular/ prefix, and an unknown name is a type error in a TypeScript config. The examples read TypeScript with the typescript-eslint parser.

defaults

// eslint.config.js
import tsParser from '@typescript-eslint/parser';
import { defineConfig } from 'eslint/config';
import stoicAngular from 'eslint-plugin-stoic-angular';

export default defineConfig({
  files: ['**/*.ts'],
  languageOptions: { parser: tsParser },
  extends: [
    stoicAngular.defaults({
      'max-function-lines': { maxLines: 8 }, // override the options
      'no-else': false, // leave the rule out
    }),
  ],
});
  • A rule that is not listed stays enabled with its default options. A rule you add to the plugin later is enabled the same way.
  • The value is the first option of the rule (an override), true (enabled with the default options, to make it explicit) or false (the rule is not enabled).
  • defaults() without an argument enables everything.

configure

export default defineConfig({
  files: ['**/*.ts'],
  languageOptions: { parser: tsParser },
  extends: [
    stoicAngular.configure({
      'max-function-lines': { maxLines: 8 },
      'no-nested-ternary': true,
    }),
  ],
});
  • Only the rules you list are enabled.
  • true enables a rule with its default options. A rule that takes options also accepts them as the value.
  • The same call also enables the ESLint core rules listed under Core rules. Their keys have no prefix, and they are enabled under their own names (no-nested-ternary, not stoic-angular/no-nested-ternary).

oxlint

The plugin runs as an oxlint JS plugin (alpha). Load the built entry point (dist/index.js) with an alias in .oxlintrc.json and enable the rules by their prefixed names:

{
  "jsPlugins": [{ "name": "stoic-angular", "specifier": "./node_modules/eslint-plugin-stoic-angular/dist/index.js" }],
  "rules": {
    "stoic-angular/max-function-lines": "error"
  }
}

See oxlint compatibility for what has been verified.

Rules

🔧 Automatically fixable by the --fix CLI option.

| Name                         | Description | 🔧 | | :------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | :- | | call-or-pass | Disallows using the same variable for both member access and argument passing. | | | if-only-at-start | Requires an if statement to be only at the start of a function, which does nothing else. | | | max-function-lines | Limits the number of logic lines in a function body. | | | no-class-inheritance | Forbids inheriting from classes and requires sharing implementation through delegation. | | | no-declarable-accessor | Forbids getters and setters in Angular components, directives and pipes and requires signals, signal inputs or methods instead. | | | no-declarable-private-method | Forbids private methods in Angular components, directives and pipes and requires moving the logic to collaborating objects. | | | no-else | Disallows combining if and else. | | | no-extra-exports | Requires a file that exports a class decorated with an Angular decorator to export nothing else. | | | no-inline-union | Requires union types to be written only inside type alias declarations. | | | no-switch | Disallows default in switch and requires every case to end with return. | | | prefer-inline-template | Requires short templates to be inline templates instead of templateUrl. | 🔧 |

Core rules

configure can enable the following ESLint core rules, which fit the same discipline, and defaults enables all of them. With configure, each one is opt-in, like the plugin rules.

  • no-nested-ternary: Disallows nested ternary expressions.
  • complexity: Limits the cyclomatic complexity of a function. true keeps ESLint's default limit of 20; pass a number, for example complexity: 5, for a stricter one.
  • no-sequences: Disallows the comma operator, so that several expressions cannot be packed into one statement. true keeps ESLint's default, which allows a sequence in explicit parentheses; pass { allowInParentheses: false } to forbid those too.

License

MIT