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-powershell

v0.1.1

Published

Native-PowerShell-free ESLint plugin, parser, and CLI for linting PowerShell scripts.

Readme

eslint-plugin-powershell

CI Tests pnpm ESLint

Native-PowerShell-free linting for PowerShell scripts.

This package provides:

  • an ESLint parser for .ps1, .psm1, and .psd1 files
  • PSScriptAnalyzer-inspired rules implemented in JavaScript
  • a standalone CLI for runners that do not support custom ESLint parsers
  • a parser backend boundary designed so tree-sitter WASM can be added without changing rule APIs

It does not shell out to pwsh, Windows PowerShell, PowerShellEditorServices, or PSScriptAnalyzer.

Install

pnpm add -D eslint-plugin-powershell

ESLint flat config

import powershell from "eslint-plugin-powershell";

export default [...powershell.configs.recommended];

Or configure it manually:

import powershell from "eslint-plugin-powershell";
import parser from "eslint-plugin-powershell/parser";

const recommendedRules = powershell.configs.recommended[0].rules;

export default [
  {
    files: ["**/*.{ps1,psm1,psd1}"],
    languageOptions: {
      parser,
    },
    plugins: {
      powershell,
    },
    rules: recommendedRules,
  },
];

CLI

pnpm exec powershell-eslint "scripts/**/*.ps1"

JSON output:

pnpm exec powershell-eslint "scripts/**/*.ps1" --format json

Oxlint and other runners

Oxlint supports many ESLint-compatible JavaScript plugins, but its current documentation says custom file formats and parsers are not supported yet. That means this package cannot make oxlint parse PowerShell files directly today.

Use the standalone CLI beside oxlint in CI:

oxlint .
pnpm exec powershell-eslint "**/*.{ps1,psm1,psd1}"

The rule metadata and standalone linter are intentionally runner-neutral so other tools can call lintText from eslint-plugin-powershell/linter.

Native-free parser strategy

PowerShell's canonical AST is produced by System.Management.Automation.Language.Parser, which is what PSScriptAnalyzer builds on. This package avoids that dependency. The default ESLint parser is a synchronous JavaScript lexer and AST adapter because ESLint parsers are synchronous.

The parser and rules are intentionally separated so a future async tree-sitter WASM backend can feed the same rule layer for tools that can await parsing. ESLint itself still needs the synchronous parser exported from eslint-plugin-powershell/parser.

Rule Coverage

The PSScriptAnalyzer-compatible rule names are the primary supported surface. See docs/rule-coverage.md for implemented native-free checks, formatter-delegated rules, and unsupported rules that require PowerShell AST/runtime metadata, byte-level input, or module layout analysis.

References

This project follows the same broad separation used by the PowerShell tooling ecosystem:

This package mirrors that shape in JavaScript: parser adapter, rule metadata, and runner integrations are separate pieces.