Registry / devops / eslint-plugin-actions

eslint-plugin-actions

JSON →
library2.0.0jsnpmunverified

An ESLint plugin that lints JavaScript code embedded in GitHub Actions workflow files (`.yml`/`.yaml`). Version 2.0.0 supports ESLint 8 and Node 12+; Node 10, 13, 15 and ESLint 6/7 are dropped. The plugin provides a processor that extracts JS from literal blocks (e.g., `script:` in `actions/github-script`) and lint them with standard ESLint rules. Recommended config `plugin:actions/recommended` enables the processor automatically. Unlike generic YAML linting tools, it gives full ESLint support for inline JS with virtual filenames for granular rule overrides. Experimental auto-fixing is available.

npm install eslint-plugin-actions
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-ACTI
E
eslint-plugin-actions
devopsjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
module.exports = { plugins: ['actions'] }
const plugin = require('eslint-plugin-actions')
Use the string 'actions' in ESLint config's plugins array; no direct import needed.
configs.recommended
extends: ['plugin:actions/recommended']
extends: ['actions/recommended']
ESLint expects the full 'plugin:' prefix for plugin configs.
processor
processor: 'actions/actions'
processor: 'eslint-plugin-actions/actions'
Processor name is 'actions/actions' (plugin name + 'actions').

Enable the plugin via the recommended config and ensure .github directory is not ignored.

// .eslintrc.json { "extends": ["plugin:actions/recommended"], "ignorePatterns": ["!/.github"] }
Debug
Known issues
breakingNode 10, 13, 15 and ESLint 6, 7 are no longer supported.
fix
Upgrade to Node >=12.22.0 and ESLint >=8.0.0.
affects: >=2.0.0
deprecatedESLint 6 and 7 support removed in v2.0.0.
fix
Use ESLint 8+.
affects: >=2.0.0
gotchaAutofixing is experimental and may change whitespace. Always review results.
fix
Avoid --fix in production; manually check diffs.
affects: >=1.0.0
gotchaOnly literal blocks (`|`) are supported; folded blocks (`>`) or other YAML multi-line strings are not linted.
fix
Use `|` for script content in workflows.
affects: >=1.0.0
gotchaRules like `indent` require `outerIIFEBody: 0` because scripts are wrapped in an IIFE.
fix
Set indent rule option: ['error', 2, { outerIIFEBody: 0 }].
affects: >=1.0.0
Errors
Common errors & fixes
Oops! Something went wrong! :( ESLint: 8.57.0 ESLint couldn't find the plugin "eslint-plugin-actions". The plugin is not installed.
Plugin not installed in node_modules.
fix
Run `npm install eslint-plugin-actions --save-dev`.
Configuration for rule "indent" is invalid: Value "outerIIFEBody" is not defined.
Missing outerIIFEBody option in indent rule configuration.
fix
Add outerIIFEBody: 0 to the indent rule options.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required, version ^8.0.0
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-actions — npm install eslint-plugin-actions · libregistry