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

@sankalpmukim/hadolint-lsp

v0.1.0

Published

Language Server Protocol implementation for Hadolint

Readme

Hadolint LSP

A Language Server Protocol implementation for Hadolint, the Dockerfile linter.

Installation

npx @sankalpmukim/hadolint-lsp

Or install globally:

npm install -g @sankalpmukim/hadolint-lsp

OpenCode Integration

To use hadolint-lsp with OpenCode, add it to your opencode.json configuration file:

Local Configuration

Add to your project-local opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "lsp": {
    "hadolint": {
      "command": ["npx", "-y", "@sankalpmukim/hadolint-lsp", "--stdio"],
      "extensions": ["Dockerfile", "dockerfile"]
    }
  }
}

Global Configuration

Add to your global OpenCode config (usually at ~/.config/opencode/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "lsp": {
    "hadolint": {
      "command": ["npx", "-y", "@sankalpmukim/hadolint-lsp", "--stdio"],
      "extensions": ["Dockerfile", "dockerfile"]
    }
  }
}

If you have installed @sankalpmukim/hadolint-lsp globally, you can use:

{
  "$schema": "https://opencode.ai/config.json",
  "lsp": {
    "hadolint": {
      "command": ["hadolint-lsp", "--stdio"],
      "extensions": ["Dockerfile", "dockerfile"]
    }
  }
}

Notes

  • The LSP server communicates via stdio, so the --stdio flag is important
  • The extensions array specifies which file extensions the LSP should handle
  • OpenCode will automatically start the LSP server when you open a Dockerfile
  • Make sure hadolint is available in your PATH (see Requirements section)

Requirements

This LSP server requires hadolint to be installed and available in your PATH.

Install hadolint:

# On macOS
brew install hadolint

# On Linux
wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
chmod +x /usr/local/bin/hadolint

# Or using Docker (but LSP will not work with Docker)
docker pull hadolint/hadolint

Usage

Editor Integration

VS Code

Create or edit .vscode/settings.json:

{
  "dockerfile.languageserver": {
    "dockerfile-language-server-node": {
      "command": "@sankalpmukim/hadolint-lsp"
    }
  }
}

Or use with Docker extension that supports LSP.

Vim/Neovim

With nvim-lspconfig:

require'lspconfig'.hadolint_lsp.setup{
  cmd = { "@sankalpmukim/hadolint-lsp" },
  filetypes = { "dockerfile" },
  root_dir = require('lspconfig').util.root_pattern(".hadolint.yaml"),
}

Emacs

With lsp-mode:

(use-package lsp-mode
  :config
  (lsp-register-client
    (make-lsp-client :new-connection (lsp-stdio-connection "@sankalpmukim/hadolint-lsp")
                     :major-modes '(dockerfile-mode)
                     :server-id 'hadolint-lsp)))

Features

  • Real-time Dockerfile linting
  • Diagnostic highlighting
  • Error, warning, info, and style level detection
  • Supports all Hadolint rules
  • Respects inline ignore pragmas (# hadolint ignore=DLxxxx)

Configuration

The LSP server respects Hadolint configuration files:

  • .hadolint.yaml in the project root
  • $XDG_CONFIG_HOME/hadolint.yaml
  • $HOME/.config/hadolint.yaml
  • $HOME/.hadolint.yaml

Example .hadolint.yaml:

failure-threshold: warning
ignored:
  - DL3008
override:
  error:
    - DL3006
  warning:
    - DL3015

Testing

Run the test suite:

npm test

The test suite covers:

  • Hadolint integration
  • Severity mapping
  • Diagnostic generation
  • Package structure validation
  • Executable verification

All tests should pass (17 total tests as of v0.1.0).

Development

# Install dependencies
npm install

# Run tests
npm test

# Run in development mode
node src/index.js --stdio

License

GPL-3.0

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Related