ESLint Azure DevOps Formatter
raw JSON → 1.2.1 verified Sat Apr 25 auth: no javascript
An ESLint formatter that outputs errors and warnings as Azure DevOps (Azure Pipelines, TFS/VSTS) logging commands, enabling direct integration with build and release pipelines. Current stable version is 1.2.1 (Dec 2024). Released under MIT license by Engage Software. Features: supports both error and warning logging, optional task completion markers (partial success for warnings via ESLINT_AZDO_LOG_TASK_COMPLETE), max-warnings support since v1.1.0. Requires Node.js >=14. ESM-only since v1.0.0. Key differentiator: native integration with Azure DevOps pipeline log commands, no dependencies beyond ESLint.
Common errors
error Error: Failed to load formatter 'eslint-formatter-azure-devops' ↓
cause The package is not installed or ESLint cannot locate it.
fix
Install the package: npm install --save-dev eslint-formatter-azure-devops
error Cannot find module 'eslint-formatter-azure-devops' ↓
cause Direct require() of the package outside ESLint's formatter resolution.
fix
Use ESLint's loadFormatter() method or CLI --format flag.
error The formatter did not return a function. ↓
cause Attempting to import the package as a JavaScript module directly.
fix
Do not import the formatter directly; let ESLint load it internally.
error Warning: Task is not marked as partially succeeded even with ESLINT_AZDO_LOG_TASK_COMPLETE set ↓
cause Environment variable not set before ESLint execution or set to an empty string.
fix
Set ESLINT_AZDO_LOG_TASK_COMPLETE to any non-empty value (e.g., 'true') before invoking ESLint.
Warnings
breaking Drop Node 12 support, require Node >=14 ↓
fix Upgrade Node.js to version 14 or higher.
deprecated max-warnings support added in v1.1.0; earlier versions silently ignore --max-warnings ↓
fix Upgrade to v1.1.0 or later to use --max-warnings.
deprecated Boolean environment variable ESLINT_AZDO_LOG_TASK_COMPLETE must be set to a truthy value ↓
fix Set the environment variable before running ESLint: ESLINT_AZDO_LOG_TASK_COMPLETE=true
gotcha Formatters are resolved relative to the current working directory if not installed globally or in the project's node_modules ↓
fix Ensure eslint-formatter-azure-devops is in the local node_modules (npm install --save-dev eslint-formatter-azure-devops)
Install
npm install eslint-formatter-azure-devops yarn add eslint-formatter-azure-devops pnpm add eslint-formatter-azure-devops Imports
- eslint-formatter-azure-devops wrong
require('eslint-formatter-azure-devops')correctimport('eslint-formatter-azure-devops') - formatter (ESLint CLI) wrong
eslint -f eslint-formatter-azure-devops src/correcteslint --format eslint-formatter-azure-devops src/ - eslint.loadFormatter wrong
const formatter = require('eslint-formatter-azure-devops');correctconst eslint = new ESLint(); const formatter = await eslint.loadFormatter('eslint-formatter-azure-devops');
Quickstart
// Ensure ESLint is installed
// Run ESLint with the Azure DevOps formatter
npx eslint --format eslint-formatter-azure-devops src/
// For task partial success on warnings, set environment variable
cross-env ESLINT_AZDO_LOG_TASK_COMPLETE=true npx eslint --format eslint-formatter-azure-devops src/