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

eslint-plugin-makefmt

v0.0.6

Published

ESLint plugin that formats Makefiles and justfiles with makefmt. Aligns assignments and line continuations, indents conditionals, and formats recipes as shell.

Downloads

254

Readme

eslint-plugin-makefmt

Format Makefiles and justfiles through ESLint with makefmt. Aligns assignments and line continuations, indents conditionals, and formats recipes as shell with the rules of shfmt. Justfiles get the same output as just --fmt.

CC=gcc
CFLAGS   :=-O2 -Wall

ifeq ($(DEBUG),1)
CFLAGS += -g
endif

becomes

CC     = gcc
CFLAGS := -O2 -Wall

ifeq ($(DEBUG),1)
  CFLAGS += -g
endif

The formatter is written in Rust and runs inside ESLint as WebAssembly, so there is nothing else to install.

Install

npm install --save-dev eslint eslint-plugin-makefmt

Requires ESLint 9.7 or later with flat config.

Usage

// eslint.config.js
import makefmt from 'eslint-plugin-makefmt'

export default [...makefmt.configs.recommended]

Then run npx eslint . to check and npx eslint --fix . to format.

The recommended config lints these files with the makefmt/format rule:

| Language | Files | | -------- | ---------------------------------------------------------------- | | Makefile | Makefile, makefile, GNUmakefile, *.mk, *.mak, *.make | | justfile | justfile, Justfile, .justfile, *.just |

Custom setup

Pick the language and the files yourself:

import makefmt from 'eslint-plugin-makefmt'

export default [
  {
    files: ['**/*.makefile'],
    plugins: { makefmt },
    language: 'makefmt/makefile',
    rules: {
      'makefmt/format': ['error', { indentWidth: 4 }],
    },
  },
]

The plugin provides two languages, makefmt/makefile and makefmt/justfile, and one rule, makefmt/format. The rule reports files that are not formatted, and --fix formats them. Files that can't be formatted, such as a justfile with a syntax error, are reported with the error.

Rule options

| Option | Default | Description | | ------------------------ | ------- | --------------------------------------------------- | | alignAssignments | true | Align assignment operators of consecutive variables | | alignAcrossComments | false | Keep aligning across comment lines | | alignContinuations | true | Align trailing backslashes of continued lines | | formatRecipes | true | Format recipe lines as shell with shfmt's rules | | indentConditionals | true | Indent conditional blocks such as ifeq/ifdef | | indentWidth | 2 | Spaces per indentation level | | maxBlankLines | 1 | Most consecutive blank lines to keep | | trimTrailingWhitespace | false | Also trim trailing whitespace on assignment lines |

Make keeps trailing whitespace in a variable's value, so PORT := 2184 sets PORT to 2184 . makefmt leaves it alone unless you turn on trimming, which can change values that relied on it.

The options only apply to Makefiles. Justfiles always use the style of just --fmt.

Project config

A .makefmt.toml in the Makefile's folder or any parent folder takes precedence over the rule options, so ESLint, the CLI and the VS Code extension all produce the same output:

align_across_comments = false
align_assignments = true
align_continuations = true
format_recipes = true
indent_conditionals = true
indent_width = 4
max_blank_lines = 1
trim_trailing_whitespace = false

Missing keys use the defaults. Unknown keys are an error.

ESLint's --cache doesn't know about .makefmt.toml, so delete the cache file (.eslintcache by default) after changing it.

oxlint

oxlint can load this plugin through jsPlugins and validates the rule options, but it can't lint Makefiles or justfiles yet: its JS plugins only run on JavaScript and TypeScript files, and custom languages are not supported. Use ESLint, or the makefmt CLI, for these files.