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

@fluid-project/fluid-lint

v1.0.0

Published

Linting of Infusion 6 JavaScript and Single File Components - a lezer grammar of the runes of configuration, nested within JavaScript and SFCs, and a linter of layer records, for CodeMirror 6 and node

Readme

@fluid-project/fluid-lint

Linting of Infusion 6 JavaScript and Single File Components, for CodeMirror 6 and for node.

What it reads

  • JavaScript is parsed by @lezer/javascript. Within it, the grammar of configuration's runes, grammar/fluid-runes.grammar, is nested over the interior of each String and template literal which configures a layer: those within the record written to fluid.def, passing through objects and arrays but never into code, e.g. the body of a function written as a func. A String held at template or partialTemplate is read as a template, unless it is a reference or a compact record.
  • SFCs are parsed by @lezer/html in its self-closing dialect. The JavaScript of each top-level <script> is read as above, and the interpolations of its <template>.
  • The grammar of runes has three top rules:
    • Value - a configuration String, read as Infusion reads it, by its first character: a reference {context selector}.path:label, a compact record $type:fn(args), a backslash-escaped literal, or a plain literal.
    • Template - text holding interpolations @{...}, in which @@{ is literal.
    • CallBody - a call without its rune, e.g. the forward of a $lens.

What it checks

  • Syntax. JavaScript and HTML syntax, and the syntax of every rune, down to its interior. Examples: an unclosed reference or call, a malformed interpolation, a $ beginning a literal, which should be written \\$.
  • Compact records. The directive of each compact record, which must be $compute, $effect or $method. $effect must list its arguments. A quoted argument draws a warning, since compact arguments are not unquoted.
  • Directives of layer records.
    • $layers, $variety and $importMap belong to a record.
    • $for and $if belong to the record of a $component.
    • A member's directives ($compute, $effect, $method, $lens, $bindable, $linkage, $component, $reactiveRoot, $transient) stand alone as the single key of the member's record.
  • Full forms. Their keys and required members, e.g. a function record's func, a $lens's source, or a $for's source. A $component's record is linted in turn as a layer record.
  • Recovery. A missing comma between the members of an object or the elements of an array is reported, and repaired in place for the rest of the linting, so that one slip doesn't hide the errors after it. A mismatched or unclosed bracket is reported with the line of the bracket left open. Errors within a rune are described by what is missing, e.g. an unclosed reference or call, an empty argument, or text after a whole rune.
  • Fragments. A fragment of a record, e.g. view: {$component: {...}}, as documentation shows, is linted as if within a record. isFragment tells whether a text is one.

Use

  • In node: lint(text, kind) in src/fluidLint.js returns diagnostics {from, to, severity, message}. kind is "js" or "vue", and by default is guessed from the text.
  • Through ESLint: eslint-plugin-fluid-lint reports its diagnostics as ESLint rules. Infusion's own npm run lint applies it.
  • A summary of ESLint's run: eslint-summary-formatter.cjs is a formatter for ESLint 8 or later, an optional peer dependency. It prints ESLint's own "stylish" report, followed by a count of the files free of errors and warnings, e.g. 138/138 files lint free. Use it as eslint --format ./node_modules/fluid-lint/eslint-summary-formatter.cjs .... Infusion's npm run lint uses it.
  • For CodeMirror 6: src/codemirror.js provides the languages (fluidJavaScript, fluidSfc), the linter (fluidLinter), and fluidEditor, which makes an editor of either.
  • The bundle: npm run build regenerates the parser from the grammar, and bundles src/codemirror.js with CodeMirror as the browser global fluid.codemirror6, into Infusion's src/lib/fluid-lint/fluid-lint.js. fluid.liveExample loads that bundle; it is the live example of Infusion's documentation.
  • Tests: npm test runs test/lintTests.js. The live example's own tests are in tests/framework-tests/components/html/LiveExampleTests.html.

The package is ESM, as the parser lezer-generator writes is. @codemirror/view and @codemirror/state are pinned to the versions @codemirror/lint requires, since a second copy of either within the bundle silently disables the linter.