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

@ynode/sqrl-lint

v1.4.2

Published

Tag-aware linter, formatter, and Prettier plugin for Squirrelly (.sqrl) templates

Readme

@ynode/sqrl-lint

Copyright (c) 2026 Michael Welter [email protected]

npm version License: MIT

A dedicated, lightning-fast linter and formatter for Squirrelly (.sqrl) templates, built specifically for the @ynode Fastify ecosystem. Uses a tag-aware scanner to normalise spacing only inside {{ ... }} boundaries, leaving surrounding HTML, CSS, and JS untouched.

Features

  • Strict Formatting: Enforces consistent spacing for helpers ({{@, {{#), base brackets ({{, }}), raw outputs ({{{, }}}), and block closures ({{/).
  • Read-Only Linters: Fails CI pipelines seamlessly by returning exit code 1 when files violate spacing norms.
  • Lightning Fast: Analyzes and natively formats files in sub-millisecond per-file times, with CLI timing metrics built-in.
  • Quality of Life: Automatically ignores node_modules by default and presents beautiful, colorized error logs and success reports.
  • Auto-Repair: The --fix option seamlessly rewrites dirty files back to pristine format natively.
  • Fast-Glob Powered: Built-in fast-glob processing natively supports arbitrary inclusion and exclusion targeting.

Installation

npm install -D @ynode/sqrl-lint

Usage

You can use the linter either manually via npx or wire it directly into your package.json scripts block.

Check Formatting (Read-Only)

npx sqrl-lint "src/**/*.sqrl"

If any files are formatted improperly, an error will be logged to stderr and the process will exit with a non-zero code (see Exit Codes).

Auto-Fix Formatting

npx sqrl-lint "src/**/*.sqrl" --fix

Automatically targets syntax violations and corrects the text natively.

JSON Reporting

npx sqrl-lint "src/**/*.sqrl" --report json

Emits a machine-readable JSON summary to stdout, suitable for CI/log parsers.

Disable ANSI Colors

npx sqrl-lint "src/**/*.sqrl" --no-color

Disables ANSI color styling in text output.

Show Diffs (Check Mode)

npx sqrl-lint "src/**/*.sqrl" --diff

Shows a unified diff for each file that needs formatting, making CI failures actionable.

Parallel Processing

npx sqrl-lint "src/**/*.sqrl" --fix --concurrency 4

Processes files with bounded parallelism for faster runs on large repositories.

Stdin / Editor Integration

cat src/views/home.sqrl | npx sqrl-lint --stdin --fix

Reads template content from stdin and writes the formatted output to stdout, making it ideal for editor "format on save" integrations, shell pipelines, and git hooks. Use --stdin-filepath <path> to control the filename shown in error messages and diffs.

Quiet Mode

npx sqrl-lint "src/**/*.sqrl" --quiet

Suppresses all output; only the exit code indicates the result.

Version

npx sqrl-lint --version

Prints the installed package version and exits.

Exit Codes

| Code | Meaning | | ---- | --------------------------------------------------------------------- | | 0 | All files are formatted correctly, or --fix completed without error | | 1 | One or more files need formatting (check mode only) | | 2 | Operational error (I/O failure, invalid arguments, permission denied) |

Formatting Rules

The linter enforces consistent spacing inside Squirrelly tag boundaries. Rules are applied in order; the first match wins.

| Tag Type | Before | After | | ------------------- | -------------------- | ---------------------- | | Helper / Macro open | {{@extends()}} | {{@ extends() }} | | Helper / Macro open | {{#if(user)}} | {{# if(user) }} | | Self-closing helper | {{@partial("x")/}} | {{@ partial("x") /}} | | Block close | {{/if}} | {{/ if }} | | Expression | {{name}} | {{ name }} | | Raw output (triple) | {{{rawHtml}}} | {{{ rawHtml }}} |

Content outside {{ ... }} boundaries (HTML, CSS, JS) is never modified.

Prettier Integration

The package ships a Prettier plugin so you can format .sqrl files alongside the rest of your codebase:

{
    "plugins": ["@ynode/sqrl-lint/prettier"]
}

Once configured, prettier --write "**/*.sqrl" will apply the same tag-spacing rules used by the CLI.

Configuration in package.json

Because this is a standard ecosystem plugin, you can easily wire it into your @ynode lint:guardrails group alongside CSS and HTML linting:

"scripts": {
    "lint:sqrl:format": "sqrl-lint \"src/**/*.sqrl\"",
    "lint:sqrl:format:fix": "sqrl-lint \"src/**/*.sqrl\" --fix",
    "lint:guardrails": "npm run lint:css && npm run lint:sqrl:format"
}

Known Limitations

Escaped / Literal Double-Braces

The tag-aware scanner treats every {{ sequence as the start of a Squirrelly tag. There is currently no escape mechanism for outputting a literal {{ or }} in your template without it being interpreted as tag syntax. If your templates need to emit raw double-brace strings (for example, Vue.js or Handlebars snippets embedded in a Squirrelly layout), wrap them in a Squirrelly raw helper or move the content to a partial that the linter does not process.

License

MIT