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

@synapsestudios/lintofu

v0.9.1

Published

ESLint plugin for linting OpenTofu configurations

Readme

lintofu

An ESLint plugin for linting OpenTofu configurations.

[!WARNING] The parser depends on Go's syscall/js, which the Go team has declared experimental and exempt from the Go compatibility promise. A future Go release may break the functionality of this plugin. lintofu will stay on 0.x until syscall/js stabilizes or we replace it. See ADR 0001.

This is a pre-release and experimental ESLint plugin.

Published to npm as @synapsestudios/lintofu.

Head striaght to the docs?

The lintofu docs are located here: synapsestudios.github.io/lintofu the frontend that represents the documentation located in docs/.

What it is

lintofu is an ESLint language plugin (the same mechanism that powers @eslint/json and @eslint/css).

It parses .tf and .tofu files using HashiCorp's own hcl/v2 parser (compiled to WebAssembly) and exposes the AST to ESLint rules so you can enforce OpenTofu or Terraform coding conventions alongside the rest of your ESLint rules.

What it (is not)

We (Synapse Studios) have been using this internally for a few months. This statement is to provide clarity on the kind of expectations you should have when engaging with it, we will accept contributions from the community, however, we can make no promises as to what kind of attention we will be able to give it when it comes to approving/reviewing/or otherwise engaging with community feedback.

This will be (for the foreseeable future) best effort and sometimes we will be too busy to triage incoming pull requests or bug reports.

AI Disclosure

To be clear, AI has been used to help build this tool, but the specifications, features, rules, the way in which the plugin handles rule precedence, processing, and the like have all been defined by humans clearly, with insight and scrutiny from a team of experienced DevOps engineers and Software Engineers in order to build something that isn't complete slop. We're tired of slop.

Scope

lintofu asserts against syntactic problems, stylistic conventions, and some provider specific code smells. We provide a list of somewhat generic (but other times opinionated) set of core rules, listed in our rules index, that you can take advantage of.

Our intentions for lintofu:

We built lintofu as a stop-gap until feature rich fully fledged linting is available. You can read more about that from the OpenTofu linting RFC. This isn't meant to be a complete replacement for what will soon be the linter implementation in OpenTofu, however, it is meant to provide all of the necessary facilities and interfaces to build a comprehensive suite of assertions and rules at the same level.

Install

Pre-requisites

Required versions:

  • Node >= 22.13
  • ESLint >= 9.x

Setup

npm install --save-dev @synapsestudios/lintofu

If you installed it from GitHub Packages before, delete these lines from your .npmrc. While they're there, npm resolves every @synapsestudios package from GitHub Packages, which no longer gets new releases:

@synapsestudios:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}

Supported versions

We would like to have as broad of compatibility as possible, so our aim is to have full compatibility with the major cloud providers in which our rules are tested against, from the last major version to the latest major version.

As this plugin ages, we expect to have to provide some backwards compatibility with our rules that may target older providers' code smells, but our focus will be on moving the tool forwards with the rest of the ecosystem. Our full decision making record and rationale on this is defined in ADR 0005.

The parser wraps HashiCorp's hcl/v2, which parses HCL2, the syntax that shipped with Terraform 0.12. We _will not be supporting hcl/v1 or Terraform versions that pre-date 0.12.

| Tool | Versions | Status | | --------- | -------------- | ----------- | | OpenTofu | 1.6 and newer | supported | | Terraform | 1.0 and newer | supported | | Terraform | 0.12 – 0.15 | best effort | | Terraform | 0.11 and older | unsupported |

  • supported: We focus on building rules that apply to these versions.
  • best effort: Some rules may target these specific versions and the gotchas associated with upgrading from them, but we won't be writing rules that target specific syntax that is only applicable to these versions.
  • unsupported: The parser will reject these.

Tested provider versions

Provider-specific rules are validated against these versions. This is a list located here: provider-versions.json which defines which provider versions we test against in CI.

  • aws provider v6.42.0
  • cloudflare provider v5.24.0

Usage

// eslint.config.js
import lintofu from "@synapsestudios/lintofu";

export default [lintofu.configs.recommended];

Or opt into specific rules and error statuses.

// eslint.config.js
import lintofu from "@synapsestudios/lintofu";

export default [
  {
    files: ["**/*.tf", "**/*.tofu"],
    plugins: { lintofu },
    language: "lintofu/opentofu",
    rules: {
      "lintofu/documented-variables": "error",
      "lintofu/required-providers-pinned": "error",
    },
  },
];

Rules

Every rule's description, severity, category, recommended flag, and autofix support lives in the generated Rule index on the documentation site

Requesting a rule

To suggest a new rule, open a rule request. The form asks for a snippet the rule should flag, the compliant form, a category, a suggested severity, whether an autofix seems possible, and any references. One of our maintainers will pick up your issue and approve it or reject it with a reason.

Parser services

Rules can reach a lazily-built, cross-file index through context.sourceCode.parserServices.projectIndex. The ProjectIndex interface and its module-directory scope are documented in the developer guide: on the site or docs/developer-guide/parser-services.md in this repository.

Writing your own rule

lintofu re-exports the rule-authoring types it uses internally, so a custom rule type-checks without reaching into private modules. We have an example of this on the site or docs/developer-guide/writing-a-rule.md in this repository.

Architecture

The parser is Go: github.com/hashicorp/hcl/v2/hclsyntax compiled to WebAssembly. We have a simple ASCII representation of the architecture here on the site or docs/developer-guide/architecture.md in this repository.

Known limitations

  • .tf.json / .tofu.json not supported. The JSON form of HCL is not 1:1 with native syntax; see hashicorp/hcl#627 for the rationale.
  • No TFLint custom-rule compatibility. We are considering adding tflint support so that users can import rules, but we haven't made a decision on whether or not it should happen.