{"id":25956,"library":"monolinter","title":"Monolinter","description":"Monolinter is a CLI tool for validating consistency across multiple package.json files in a monorepo (or single project). It checks for consistent package versions, duplicate package declarations, fuzzy version usage, and related package version matches. Current stable version is 1.0.5. Release cadence is low; last release was minor. Key differentiator: modular, extensible with custom validation modules, and designed for CI/CD integration. Alternatives like syncpack focus on version sync but monolinter also catches duplicates and related packages.","status":"active","version":"1.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/andresesfm/monolinter","tags":["javascript","monorepo","lint","package.json"],"install":[{"cmd":"npm install monolinter","lang":"bash","label":"npm"},{"cmd":"yarn add monolinter","lang":"bash","label":"yarn"},{"cmd":"pnpm add monolinter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"loading .monolinterrc configuration files","package":"cosmiconfig","optional":false},{"reason":"type definitions and compilation (listed as devDependency but required for runtime)","package":"typescript","optional":false}],"imports":[{"note":"Install as devDependency and run via yarn or npm scripts. npx may work but not guaranteed.","wrong":"npx monolinter","symbol":"monolinter CLI","correct":"yarn monolinter"},{"note":"Package is not explicitly ESM, but default export is available. TypeScript types included.","wrong":"const monolinter = require('monolinter');","symbol":"programmatic API","correct":"import { Monolinter } from 'monolinter';"},{"note":"cosmiconfig supports .monolinterrc, .monolinterrc.json, .monolinterrc.yaml, monolinter.config.js, etc.","wrong":"monolinter.config.ts","symbol":"config file","correct":".monolinterrc (JSON, YAML, or JS via cosmiconfig)"}],"quickstart":{"code":"// Create .monolinterrc in project root:\n{\n  \"include\": [\"package.json\", \"packages/*/package.json\"]\n}\n\n// Add script to package.json:\n{\n  \"scripts\": {\n    \"lint:mono\": \"monolinter\"\n  }\n}\n\n// Run:\nyarn lint:mono\n\n// Or run directly:\nyarn monolinter package.json 'packages/*/package.json'\n\n// Sample output on failure:\n// ✖ Found inconsistent versions for 'lodash': 4.17.0 vs 4.17.21\n// ✖ Duplicate 'express' in dependencies and devDependencies of server/package.json\n// ✖ App/package.json uses fuzzy version '^1.0.0' for 'debug'","lang":"typescript","description":"Shows basic usage with config file and CLI arguments, including example validation errors."},"warnings":[{"fix":"Use relative paths from the directory containing .monolinterrc or the root where CLI is run.","message":"Glob patterns must match relative path from config file location","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Exclude packages that use non-semver versions via exclude patterns in config.","message":"Exact version validator rejects packages without version (e.g., file: or git dependencies)","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"No migration needed; those packages are no longer required.","message":"Version 1.0.4 removed peer dependencies on @babel/core and @babel/runtime","severity":"breaking","affected_versions":">=1.0.4"},{"fix":"Check changelog for updates on related package validation.","message":"ESLint-related checks were added in 1.0.3 but not documented; may change in future","severity":"deprecated","affected_versions":">=1.0.3"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add cosmiconfig as a devDependency: yarn add -D cosmiconfig","cause":"Missing peer dependency cosmiconfig","error":"Cannot find module 'cosmiconfig'"},{"fix":"Ensure all included package.json files have a 'version' field, or exclude them from exact version validation.","cause":"A package.json file lacks a 'version' field (for exact version check)","error":"TypeError: Cannot read property 'match' of undefined"},{"fix":"Create a .monolinterrc file with at least an 'include' array.","cause":"Monolinter cannot find any config file in the project root.","error":"No configuration found. Create a .monolinterrc file."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}