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

v2.0.0

Published

Lint JS inside GitHub Actions workflow

Readme

eslint-plugin-actions

npm CI semantic-release

Lint JS inside GitHub Actions workflow

A JS script in a GitHub workflow editor has red squiggly underlines. A tooltip explains the problem.

Installation

You'll first need to install ESLint 8 or greater:

$ npm i eslint --save-dev
$ yarn add -D eslint

Next, install eslint-plugin-actions:

$ npm install eslint-plugin-actions --save-dev
$ yarn add -D eslint-plugin-actions

Usage

Extending the plugin:actions/recommended config will enable the processor on all workflow .{yml,yaml} files:

{
    "extends": ["plugin:actions/recommended"]
}

Currently, only literal blocks (|) are supported and it's recommended to use them:

# .github/workflows/ci.yml
jobs:
  build:
    steps:
    - uses: actions/github-script@v2
      with:
        script: |
          // .github/workflows/ci.yml/0_build/0.js

The autofixing (--fix) is supported, but it's still experimental and whitespace handling of YAML is different from JS, so be sure to check the result.

Advanced Configuration

Dotfiles are ignored by ESLint by default. To lint files inside .github, you'll need to add !.github to .eslintignore file or ignorePatterns of your configuration file:

!/.github

Then, add actions to the plugins section of your configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": ["actions"]
}

Use the processor option in an overrides entry to enable the plugin on workflow YAML files:

{
    "overrides": [{
        "files": [".github/workflows/*.{yml,yaml}"],
        "processor": "actions/actions"
    }]
}

Each script inside a workflow has a virtual filename appended to the YAML file's path. It has the format of [global index]_[job id]/[local index].js (see the example above). overrides glob patterns for these virtual filenames can customize configuration for scripts without affecting regular code. For more information on configuring processors, refer to the ESLint documentation:

{
    "overrides": [{
        "files": [".github/workflows/*.{yml,yaml}/*_build/*.js"],
        "rules": {
            "indent": ["error", 2, {"outerIIFEBody": 0}]
            ...
        },
        ...
    }]
}

Rules

The script will be enclosed in an IIFE async function, when processed by ESLint:

(async function(context, github, io, core) {
...
}());

Therefore, if indent or indent-legacy rule is used, the outerIIFEBody option should be set to 0 (see above). Furthermore, rules affecting the beginning and the end of the file, such as unicode-bom, eol-last and no-multiple-empty-lines, are ignored.

Supported Actions

Remark

This plugin is heavily inspired by and adapted from eslint-plugin-markdown.

License

MIT License