{"id":26094,"library":"postman-eslint","title":"postman-eslint","description":"A CLI tool for linting JavaScript scripts (pre-request and test scripts) in Postman collections using ESLint. Version 1.0.3, stable release. It fetches a Postman collection via API, extracts scripts from collection/folder/request levels, and runs ESLint with your local flat config. Differentiator: specifically targets Postman script linting with built-in globals like `pm`, uses Postman Collection SDK for parsing. Requires Node.js >=14.0.0.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/laughingbiscuit/postman-eslint-cli","tags":["javascript","postman","eslint","cli","linter","postman-collection","code-quality","testing","api-testing"],"install":[{"cmd":"npm install postman-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add postman-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add postman-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used to parse Postman collections from JSON response","package":"postman-collection","optional":false},{"reason":"Peer dependency for linting; must have ESLint installed in the project","package":"eslint","optional":true}],"imports":[{"note":"The package is a CLI tool, not a library. Use npx or install globally. The binary is `postman-eslint`.","wrong":"node postman-eslint.js","symbol":"postman-eslint (CLI)","correct":"npx postman-eslint --collection <id> --api-key <key>"},{"note":"The config file is meant to be copied, not imported. It uses CommonJS (module.exports) and is included for convenience.","wrong":"require('postman-eslint/eslint.config.js')","symbol":"ESLint config sample","correct":"cp node_modules/postman-eslint/eslint.config.js ./"},{"note":"The CLI will read POSTMAN_API_KEY from environment if --api-key is not provided. Using env var is more secure.","wrong":"postman-eslint --api-key $POSTMAN_API_KEY","symbol":"Environment variable for API key","correct":"export POSTMAN_API_KEY=your_key"}],"quickstart":{"code":"npm install -g postman-eslint\nexport POSTMAN_API_KEY='your-api-key'\npostman-eslint --collection 'your-collection-id'","lang":"bash","description":"Installs the CLI globally, sets the API key via environment variable, and lints the specified Postman collection."},"warnings":[{"fix":"Create or convert to eslint.config.js using flat config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new","message":"Requires ESLint flat config format (eslint.config.js). If you use .eslintrc, it will not work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure eslint.config.js exists where you run the command.","message":"Must have an eslint.config.js in the current working directory; does not search parent directories.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Provide API key via command line option or environment variable.","message":"API key is required; will fail if not provided via --api-key or POSTMAN_API_KEY environment variable.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check for newer versions of postman-eslint and postman-collection.","message":"Package version 1.0.3 uses older postman-collection SDK; consider updating if available.","severity":"deprecated","affected_versions":"1.0.0 - 1.0.3"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Create an eslint.config.js file (flat config) in the directory where you run postman-eslint.","cause":"Missing eslint.config.js file in the project root.","error":"Error: No ESLint config found. Please ensure eslint.config.js exists in the current directory."},{"fix":"Set POSTMAN_API_KEY environment variable or pass --api-key argument.","cause":"Neither command-line option nor environment variable set.","error":"Error: API key is required. Provide via --api-key or POSTMAN_API_KEY environment variable."},{"fix":"Verify collection ID and API key; ensure internet connectivity.","cause":"Invalid collection ID or API key, or network issue.","error":"Error: Failed to fetch collection. Check collection ID and API key."},{"fix":"npm install --save-dev eslint","cause":"ESLint is not installed in the project.","error":"Error: Cannot find module 'eslint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}