Registry / devops / spire-plugin-lint-staged

spire-plugin-lint-staged

JSON →
library5.0.7jsnpmunverified

A Spire plugin that integrates lint-staged into the Spire workflow, running lint-staged during the precommit hook. Current stable version is 5.0.9, with sporadic updates. It extends Spire's plugin system for Git precommit linting. Differs from standalone lint-staged usage by automating configuration via Spire's lifecycle hooks. Requires Spire v4 or v5 and Node >=12.20.

npm install spire-plugin-lint-staged
INSTALL
IMPORT
SIG · SPIRE-PLUGIN-LINT-
S
spire-plugin-lint-staged
devopsjavascriptv5.0.7
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.

default
const plugin = require('spire-plugin-lint-staged')
import plugin from 'spire-plugin-lint-staged'
Package is CommonJS-only; ESM import not supported. Use require() as Spire plugins expect CommonJS.
lintStagedConfig
module.exports = { plugins: [['spire-plugin-lint-staged', { lintStagedConfig: './my-config.js' }]] }
module.exports = { plugins: ['spire-plugin-lint-staged', { lintStagedConfig: './my-config.js' }] }
Options are passed as array [plugin, options] within Spire's plugin configuration.
allowCustomConfig
module.exports = { plugins: [['spire-plugin-lint-staged', { allowCustomConfig: false }]] }
module.exports = { plugins: ['spire-plugin-lint-staged', { allowCustomConfig: false }] }
Setting allowCustomConfig to false prevents user override; array format required.

Shows basic Spire configuration using the plugin with a custom lint-staged config file.

// .spirerc.js module.exports = { plugins: [ ['spire-plugin-lint-staged', { lintStagedConfig: 'lint-staged.config.js', allowCustomConfig: false }] ] }; // lint-staged.config.js module.exports = { '*.js': ['eslint --fix', 'prettier --write'] };
Debug
Known issues
breakingNode engine requirement raised to >=12.20 in v5.0.0
fix
Use Node v12.20 or higher.
affects: >=5.0.0
breakingPeer dependency spire changed from ^4.0.0 to ^4.0.0 || ^5.0.0; ensure compatible Spire version.
fix
Install spire v4 or v5 alongside this plugin.
affects: >=5.0.0
deprecatedlint-staged v11 used in older versions; v13 introduced breaking changes (e.g., removed --relative). If pinned to v5.0.6 or earlier, lint-staged v11 may be incompatible with newer Node.
fix
Upgrade to v5.0.7+ which uses lint-staged v13, or manually set lint-staged version in your project.
affects: <=5.0.6
gotchaPlugin name mismatch: npm package is 'spire-plugin-lint-staged' but Spire plugin array expects the string exactly as 'spire-plugin-lint-staged' (not 'lint-staged' or 'spire-lint-staged').
fix
Use the exact package name 'spire-plugin-lint-staged' in the plugins array.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Plugin 'spire-plugin-lint-staged' not found or not a function.
Package not installed or require() fails due to missing dependency or incorrect path.
fix
Run: npm install spire-plugin-lint-staged --save-dev
Error: Cannot find module 'spire-plugin-lint-staged'
Package not installed or node_modules path issue.
fix
Install the package: npm install spire-plugin-lint-staged
TypeError: plugins[i] is not iterable
Plugin options not wrapped in array (e.g., using string instead of [name, opts] tuple).
fix
Change plugin entry to: ['spire-plugin-lint-staged', { ... }]
Error: Custom lint-staged config found but allowCustomConfig is false.
User has a lint-staged config file in project root but plugin option allowCustomConfig set to false.
fix
Set allowCustomConfig to true or remove custom config file.
Upgrade
Version history
5.0.7latest on npm
Audit
Dependencies
spirerequiredpeer dependency: plugin requires Spire runtime v4 or v5
lint-stagedrequiredruntime dependency: executes lint-staged on precommit
Agent activity
4 hits · last 30 days
node
4
Resources
spire-plugin-lint-staged — npm install spire-plugin-lint-staged · libregistry