{"id":26422,"library":"spire-plugin-lint-staged","title":"spire-plugin-lint-staged","description":"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.","status":"active","version":"5.0.7","language":"javascript","source_language":"en","source_url":"https://github.com/researchgate/spire","tags":["javascript"],"install":[{"cmd":"npm install spire-plugin-lint-staged","lang":"bash","label":"npm"},{"cmd":"yarn add spire-plugin-lint-staged","lang":"bash","label":"yarn"},{"cmd":"pnpm add spire-plugin-lint-staged","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: plugin requires Spire runtime v4 or v5","package":"spire","optional":false},{"reason":"runtime dependency: executes lint-staged on precommit","package":"lint-staged","optional":false}],"imports":[{"note":"Package is CommonJS-only; ESM import not supported. Use require() as Spire plugins expect CommonJS.","wrong":"import plugin from 'spire-plugin-lint-staged'","symbol":"default","correct":"const plugin = require('spire-plugin-lint-staged')"},{"note":"Options are passed as array [plugin, options] within Spire's plugin configuration.","wrong":"module.exports = { plugins: ['spire-plugin-lint-staged', { lintStagedConfig: './my-config.js' }] }","symbol":"lintStagedConfig","correct":"module.exports = { plugins: [['spire-plugin-lint-staged', { lintStagedConfig: './my-config.js' }]] }"},{"note":"Setting allowCustomConfig to false prevents user override; array format required.","wrong":"module.exports = { plugins: ['spire-plugin-lint-staged', { allowCustomConfig: false }] }","symbol":"allowCustomConfig","correct":"module.exports = { plugins: [['spire-plugin-lint-staged', { allowCustomConfig: false }]] }"}],"quickstart":{"code":"// .spirerc.js\nmodule.exports = {\n  plugins: [\n    ['spire-plugin-lint-staged', {\n      lintStagedConfig: 'lint-staged.config.js',\n      allowCustomConfig: false\n    }]\n  ]\n};\n\n// lint-staged.config.js\nmodule.exports = {\n  '*.js': ['eslint --fix', 'prettier --write']\n};","lang":"javascript","description":"Shows basic Spire configuration using the plugin with a custom lint-staged config file."},"warnings":[{"fix":"Use Node v12.20 or higher.","message":"Node engine requirement raised to >=12.20 in v5.0.0","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Install spire v4 or v5 alongside this plugin.","message":"Peer dependency spire changed from ^4.0.0 to ^4.0.0 || ^5.0.0; ensure compatible Spire version.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Upgrade to v5.0.7+ which uses lint-staged v13, or manually set lint-staged version in your project.","message":"lint-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.","severity":"deprecated","affected_versions":"<=5.0.6"},{"fix":"Use the exact package name 'spire-plugin-lint-staged' in the plugins array.","message":"Plugin 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').","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: npm install spire-plugin-lint-staged --save-dev","cause":"Package not installed or require() fails due to missing dependency or incorrect path.","error":"Error: Plugin 'spire-plugin-lint-staged' not found or not a function."},{"fix":"Install the package: npm install spire-plugin-lint-staged","cause":"Package not installed or node_modules path issue.","error":"Error: Cannot find module 'spire-plugin-lint-staged'"},{"fix":"Change plugin entry to: ['spire-plugin-lint-staged', { ... }]","cause":"Plugin options not wrapped in array (e.g., using string instead of [name, opts] tuple).","error":"TypeError: plugins[i] is not iterable"},{"fix":"Set allowCustomConfig to true or remove custom config file.","cause":"User has a lint-staged config file in project root but plugin option allowCustomConfig set to false.","error":"Error: Custom lint-staged config found but allowCustomConfig is false."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}