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

@birdcc/linter

v0.1.0-beta.0

Published

Lint rule engine for BIRD2 configuration files.

Readme

🧩 BIRD Config Linter (@birdcc/linter)

⚠️ Alpha Stage: This package is in early development. APIs may change frequently, and unexpected issues may occur. Please evaluate carefully before deploying in production environments.

npm version License: GPL-3.0 TypeScript

Overview · Features · Installation · Usage · Rules · API Reference

Overview

@birdcc/linter is the rule engine layer of the BIRD-LSP toolchain, providing a pluggable lint rule system for checking protocol compliance, security, and performance issues in BIRD2 configuration files.


Features

  • 🧩 Pluggable Rules — Flexible rule system based on the BirdRule type
  • 🌐 Protocol Rules — BGP/OSPF configuration completeness checks
  • 🔒 Security Rules — Configuration security best practices
  • Performance Rules — Performance optimization recommendations
  • 🔍 32+ Built-in Rules — Comprehensive coverage of common issues

Installation

# Using pnpm (recommended)
pnpm add @birdcc/linter

# Using npm
npm install @birdcc/linter

# Using yarn
yarn add @birdcc/linter

Usage

Basic Linting

import { lintBirdConfig } from "@birdcc/linter";

const config = `
protocol bgp example {
  neighbor 192.168.1.1 as 65001;
}
`;

const result = lintBirdConfig(config);

console.log(result.diagnostics);
// [{ code: "bgp/missing-local-as", message: "BGP protocol missing local as configuration", severity: "warning" }]

Reference Samples Sync

pnpm --filter @birdcc/linter sync:examples

This command copies refer/vscode-bird2/syntaxes/bird-tm-grammar/sample/*.conf to packages/@birdcc/linter/examples/ and runs automatically during build and test.

Custom Rules

import type { BirdRule, BirdDiagnostic } from "@birdcc/linter";

const namingConventionRule: BirdRule = ({ core }) => {
  const diagnostics: BirdDiagnostic[] = [];

  for (const symbol of core.symbols) {
    if (symbol.kind === "protocol") {
      if (!/^[a-z][a-z0-9-]*$/.test(symbol.name)) {
        diagnostics.push({
          code: "structure/invalid-protocol-name",
          message: `Protocol name '${symbol.name}' should only contain lowercase letters, numbers, and hyphens`,
          severity: "warning",
          source: "linter",
          range: {
            /* ... */
          },
        });
      }
    }
  }

  return diagnostics;
};

Rules

Symbol Rules (sym/*)

| Rule | Description | Level | | ------------------------- | ----------------------------- | ----- | | sym/undefined | Reference to undefined symbol | error | | sym/duplicate | Duplicate symbol definition | error | | sym/proto-type-mismatch | Protocol type mismatch | error |

Config Rules (cfg/*)

| Rule | Description | Level | | ------------------------ | ------------------------ | ----- | | cfg/no-protocol | No protocol defined | error | | cfg/missing-router-id | Missing router id | error | | cfg/syntax-error | Syntax error detected | error | | cfg/value-out-of-range | Value out of valid range | error |

Network Rules (net/*)

| Rule | Description | Level | | --------------------------- | --------------------- | ----- | | net/invalid-prefix-length | Invalid prefix length | error | | net/invalid-ipv4-prefix | Invalid IPv4 prefix | error | | net/invalid-ipv6-prefix | Invalid IPv6 prefix | error |

Type Rules (type/*)

| Rule | Description | Level | | ------------------- | -------------------- | ----- | | type/mismatch | Type mismatch | error | | type/not-iterable | Non-iterable in loop | error |

BGP Rules (bgp/*)

| Rule | Description | Level | | ----------------------- | ------------------ | ------- | | bgp/missing-local-as | Missing local AS | warning | | bgp/missing-neighbor | Missing neighbor | warning | | bgp/missing-remote-as | Missing remote AS | warning | | bgp/as-mismatch | AS number mismatch | warning |

OSPF Rules (ospf/*)

| Rule | Description | Level | | -------------------- | -------------------------- | ------- | | ospf/missing-area | Missing area configuration | warning | | ospf/backbone-stub | Stub area on backbone | warning |


API Reference

lintBirdConfig(text: string, options?): LintResult

Perform complete lint checks (semantic analysis + rule checks).

import { lintBirdConfig } from "@birdcc/linter";

const result = lintBirdConfig(birdConfigText);
// result.parsed      → Parsed AST
// result.core        → Semantic analysis snapshot
// result.diagnostics → All diagnostic messages

Types

interface LintResult {
  parsed: ParsedBirdDocument;
  core: CoreSnapshot;
  diagnostics: BirdDiagnostic[];
}

type BirdRule = (context: RuleContext) => BirdDiagnostic[];

interface RuleContext {
  text: string;
  parsed: ParsedBirdDocument;
  core: CoreSnapshot;
}

Related Packages

| Package | Description | | ---------------------------------- | ------------------------------ | | @birdcc/parser | Tree-sitter grammar and parser | | @birdcc/core | Semantic analysis engine | | @birdcc/formatter | Code formatting engine | | @birdcc/lsp | LSP server implementation | | @birdcc/cli | Command-line interface |


📖 Documentation


📝 License

This project is licensed under the GPL-3.0 License.