{"id":19637,"library":"eslint-formatter-codeclimate","title":"ESLint formatter for Code Climate","description":"An ESLint formatter that outputs lint results in the Code Climate report format, suitable for integration with Code Climate's platform. Version 2.0.1 supports ESLint >=9 and requires Node.js 20+. The v2.0.0 release switched fingerprint hashing from SHA1 to SHA256, a breaking change. It offers both a CLI formatter (--format codeclimate) and a programmatic API (toCodeClimate). Unlike generic JSON formatters, this produces a Code Climate-specific JSON structure with categories, fingerprints, and relative paths.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remcohaszing/eslint-formatter-codeclimate","tags":["javascript","codeclimate","eslint","eslint-formatter","eslintformatter"],"install":[{"cmd":"npm install eslint-formatter-codeclimate","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-formatter-codeclimate","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-formatter-codeclimate","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required to use the formatter; must be >=9","package":"eslint","optional":false}],"imports":[{"note":"Default export is the ESLint formatter function; package is ESM-only, so require() fails with ERR_REQUIRE_ESM.","wrong":"const formatter = require('eslint-formatter-codeclimate')","symbol":"formatter","correct":"import formatter from 'eslint-formatter-codeclimate'"},{"note":"Named export for programmatic conversion; also ESM-only.","wrong":"const { toCodeClimate } = require('eslint-formatter-codeclimate')","symbol":"toCodeClimate","correct":"import { toCodeClimate } from 'eslint-formatter-codeclimate'"}],"quickstart":{"code":"import { ESLint } from 'eslint';\nimport { toCodeClimate } from 'eslint-formatter-codeclimate';\n\nconst cwd = process.cwd();\nconst eslint = new ESLint({ cwd });\nconst results = await eslint.lintFiles([]);\nconst rulesMeta = eslint.getRulesMetaForResults(results);\nconst issues = toCodeClimate(results, rulesMeta, cwd);\nconsole.log(JSON.stringify(issues, null, 2));","lang":"typescript","description":"Programmatically converts ESLint results to Code Climate format using toCodeClimate."},"warnings":[{"fix":"Update any systems that rely on fingerprint consistency (e.g., deduplication) to use the new hash.","message":"Fingerprint hash algorithm changed from SHA1 to SHA256 in v2.0.0, altering issue fingerprints.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure eslint version is 9 or above.","message":"Peer dependency requirement changed to eslint >=9 in v2.0.0.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use import syntax or dynamic import().","message":"Package is ESM-only. Using require() throws ERR_REQUIRE_ESM.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to 20+.","message":"Node.js version must be 20 or greater.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import syntax or dynamic import(), or set package type to module.","cause":"Using CommonJS require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-formatter-codeclimate/index.js from /path/to/script.js not supported."},{"fix":"Run 'npm install eslint-formatter-codeclimate'.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'eslint-formatter-codeclimate'"},{"fix":"Use import { toCodeClimate } from 'eslint-formatter-codeclimate'.","cause":"Incorrect import of default export instead of named export.","error":"TypeError: toCodeClimate is not a function"},{"fix":"Ensure the package is installed in the project and the formatter name matches the package name (--format codeclimate).","cause":"ESLint cannot find the formatter when used via CLI.","error":"Error: ESLint configuration error: The formatter 'codeclimate' is not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}