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

@farisabujolban/eslint-plugin-codeanchor

v0.2.1

Published

ESLint plugin enforcing issue-linked TODOs, scoped temporary code, and declared environment variables

Readme

eslint-plugin-codeanchor

npm version CI license

ESLint plugin for AST-level maintainability and safety checks that standard linting tools don't cover: expired comment deadlines, hardcoded secrets, insecure randomness, unguarded JSON parsing, Promise anti-patterns, resource leaks, and more. 20 rules. No external dependencies.

Companion to @farisabujolban/codeanchor CLI — the CLI handles git-aware cross-file drift; this plugin handles single-file AST-level checks.


Table of contents


Installation

npm install --save-dev @farisabujolban/eslint-plugin-codeanchor

--save-dev is appropriate here: ESLint plugins run at lint time, not at runtime. Keeping them in devDependencies prevents them from being installed in production environments and ensures every team member and CI job uses the same version.


Setup

ESLint v9 (flat config)

// eslint.config.js
import codeanchor from '@farisabujolban/eslint-plugin-codeanchor';

export default [codeanchor.configs.recommended];

Or enable rules individually:

// eslint.config.js
import codeanchor from '@farisabujolban/eslint-plugin-codeanchor';

export default [
    {
        plugins: { codeanchor },
        rules: {
            'codeanchor/todo-requires-issue': 'warn',
            'codeanchor/env-var-declared': 'error',
            'codeanchor/no-hardcoded-credential-assignment': 'error',
            'codeanchor/no-insecure-random-for-secret': 'error',
        },
    },
];

ESLint v8 (legacy .eslintrc)

// .eslintrc.js
module.exports = {
    plugins: ['@farisabujolban/codeanchor'],
    extends: ['plugin:@farisabujolban/codeanchor/legacy'],
};

Rules

Full rule reference with option tables and examples: docs/rules.md.

Comment hygiene

| Rule | Description | Default | Fixable | | -------------------------------------------- | ------------------------------------------------------------------------- | ------- | ------- | | codeanchor/todo-requires-issue | TODO/FIXME/HACK must include an issue reference (#123, URL, PROJ-123) | warn | No | | codeanchor/temp-comment-requires-condition | Temporary/workaround comments must specify a removal condition | warn | No | | codeanchor/comment-expiry-date | TODO/TEMP/WORKAROUND comments with a past expiry date | warn | No |

Environment & config

| Rule | Description | Default | Fixable | | ---------------------------------- | ------------------------------------------------------------------------ | ------- | ------- | | codeanchor/env-var-declared | process.env.X / import.meta.env.X must be declared in .env.example | error | No | | codeanchor/no-placeholder-values | Flag placeholder strings left by AI code generation | error | No |

Security

| Rule | Description | Default | Fixable | | ----------------------------------------------- | --------------------------------------------------------------------- | ------- | ------- | | codeanchor/no-hardcoded-credential-assignment | Flag hardcoded strings assigned to credential-named variables | error | No | | codeanchor/no-hardcoded-connection-string | Disallow connection strings with embedded credentials | error | No | | codeanchor/no-insecure-random-for-secret | Disallow Math.random() for secrets or tokens — use crypto instead | error | No | | codeanchor/no-hardcoded-port | Flag hardcoded port numbers in server listen calls | warn | No |

Reliability

| Rule | Description | Default | Fixable | | --------------------------------------------- | -------------------------------------------------------------------------- | ------- | ------- | | codeanchor/no-unguarded-json-parse | Require JSON.parse() to be wrapped in try/catch | warn | No | | codeanchor/no-unguarded-url-constructor | Require new URL() to be wrapped in try/catch | warn | No | | codeanchor/require-error-cause | Require { cause: err } when re-throwing inside a catch block | warn | No | | codeanchor/no-resource-leak | Require streams/servers/workers/sockets to be closed in the same scope | warn | No | | codeanchor/no-floating-point-equality | Disallow exact === comparisons with floating-point literals (CWE-1339) | warn | No | | codeanchor/no-date-constructor-without-args | Disallow new Date() without arguments — couples code to the system clock | warn | No |

TypeScript correctness

| Rule | Description | Default | Fixable | | ------------------------------------- | ----------------------------------------------------------------------- | ------- | ------- | | codeanchor/no-double-type-assertion | Flag as unknown as T assertions that bypass TypeScript's type checker | warn | No |

Performance

| Rule | Description | Default | Fixable | | ----------------------------------------- | ----------------------------------------------------------------------------------- | ------- | ------- | | codeanchor/no-object-spread-accumulator | Disallow object spread in .reduce() — creates O(n²) allocations | warn | No | | codeanchor/no-promise-constructor-wrap | Disallow wrapping a Promise-returning call in new Promise() — swallows rejections | error | No | | codeanchor/no-sync-in-async | Flag synchronous *Sync calls inside async functions | warn | No | | codeanchor/no-constructor-side-effect | Disallow I/O, timers, and network calls in class constructors | warn | No |


Companion tool

@farisabujolban/codeanchor — CLI for git-aware cross-file drift: stale docs, broken CI/Docker references, missing lockfile updates, env secret leaks, and more. Run both for full coverage.

npm install --save-dev @farisabujolban/codeanchor

Contributing

npm install
npm run build
npm test

PRs welcome. No AI in the rule logic.

License

MIT © Faris Abujolban