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/shell

v0.1.0

Published

Shell language plugin for ESLint

Readme

ESLint Shell Language Plugin

A shell language plugin for ESLint, providing:

  • an ESLint-style parser for shell scripts (wrapping mvdan-sh, the parser behind shfmt) that produces an ESTree-style syntax tree,
  • an ESLint language implementation so rules can traverse that tree,
  • rules inspired by ShellCheck checks, and
  • a recommended configuration.

Installation

npm install --save-dev eslint @eslint/shell

Requires Node.js ^20.19.0 || ^22.13.0 || >=24. Tested with ESLint v10.

Usage

Add the plugin to your eslint.config.js:

import shell from "@eslint/shell";

export default [
	// use the recommended rules for *.sh and *.bash files
	shell.configs.recommended,
];

Or configure it manually:

import shell from "@eslint/shell";

export default [
	{
		files: ["**/*.sh"],
		plugins: { shell },
		language: "shell/bash",
		rules: {
			"shell/no-backticks": "error",
			"shell/no-unquoted-expansions": "error",
		},
	},
];

Languages

The plugin provides one language per shell dialect:

| Language | Description | | ------------- | ------------------------------------- | | shell/bash | Bash. Used by the recommended config. | | shell/posix | POSIX sh, without Bash extensions. | | shell/mksh | MirBSD Korn shell. |

export default [
	{
		files: ["**/*.sh"],
		plugins: { shell },
		language: "shell/posix",
		rules: { "shell/no-backticks": "error" },
	},
];

Rules

Each rule mirrors a well-known ShellCheck check.

| Rule | ShellCheck | Description | Fixable | Recommended | | ---------------------------------------------------------------------------------- | ---------- | ------------------------------------------------------- | ------- | ----------- | | no-backticks | SC2006 | Use $(...) instead of legacy backticks | ✅ | error | | no-expansions-in-single-quotes | SC2016 | Expressions don't expand in single quotes | | warn | | no-ls-iteration | SC2045 | Don't iterate over ls output; use globs | | error | | no-unquoted-expansions | SC2086/46 | Quote expansions subject to word splitting and globbing | ✅ | error | | no-unused-vars | SC2034 | Disallow variables that are assigned but never used | | error | | no-useless-cat | SC2002 | Don't pipe from a single-file cat | | error | | no-useless-echo | SC2116 | Disallow $(echo ...) | | error | | no-variables-in-printf-format | SC2059 | Don't put variables in the printf format string | | error | | require-cd-guard | SC2164 | Handle cd failure with \|\| exit (has suggestions) | | error | | require-read-r | SC2162 | Use read -r so backslashes aren't mangled | ✅ | error |

Rule options

shell/no-unused-vars accepts an object option:

"shell/no-unused-vars": ["error", { allowed: ["MY_GLOBAL"] }]

Configuration comments

Standard ESLint configuration comments work inside shell scripts:

# eslint-disable-next-line shell/no-backticks
echo `pwd`

echo `pwd` # eslint-disable-line shell/no-backticks -- legacy

# eslint shell/no-useless-echo: "warn"

Syntax tree

The tree format is documented in docs/syntax-tree.md. Nodes carry start/end character offsets instead of range/loc properties; use sourceCode.getRange(node) and sourceCode.getLoc(node).

The parser is also exported directly:

import { parseShell } from "@eslint/shell";

const { ast, comments } = parseShell('echo "hello"\n');

Development

npm install
npm test          # unit + integration tests (Vitest)
npm run lint      # ESLint on the plugin's own sources
npm run fmt       # Prettier
npm run build     # compile TypeScript to dist/

Pre-commit hooks (via yorkie and lint-staged) run Prettier and ESLint on staged files. Releases are managed with release-please through GitHub Actions.

License

Apache-2.0

Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. Become a Sponsor to get your logo on our READMEs and website.