eslint-plugin-putout
raw JSON β 31.1.2 verified Sat Apr 25 auth: no javascript
ESLint plugin for πPutout, a code transformation tool. Current stable version is 31.1.2, released as part of the putout monorepo. The plugin provides ESLint rules that mirror Putout's linting capabilities, including formatting rules like array-element-newline, single-property-destructuring, and tape-specific rules for test files. It requires eslint >=10 and putout >=42. Key differentiator is seamless integration of Putout's code transformations into ESLint workflows, allowing users to leverage both tools in a unified configuration. Release cadence is high (multiple versions per week).
Common errors
error Cannot find module 'eslint-plugin-putout' β
cause Package not installed or wrong import path.
fix
npm i eslint-plugin-putout -D (ensure it's in package.json)
error ESLint: Failed to load plugin 'putout': Cannot find module 'putout' β
cause putout peer dependency missing.
fix
npm i putout -D
error TypeError: (0 , eslint_plugin_putout__WEBPACK_IMPORTED_MODULE_0__.default) is not a function β
cause Using named import instead of default import for the plugin object.
fix
Use "import putout from 'eslint-plugin-putout'" instead of "import { putout } from 'eslint-plugin-putout'".
error Error: Plugin 'putout' requires eslint >=10 β
cause Outdated eslint version.
fix
Update eslint to >=10: npm i eslint@^10 -D
Warnings
breaking Requires eslint >=10 and putout >=42. Older versions incompatible. β
fix Update dependencies: npm i eslint@^10 putout@^42 eslint-plugin-putout@^31 -D
breaking ESM-only package. require() will fail with ERR_REQUIRE_ESM. β
fix Use import syntax only; if using CommonJS, consider dynamic import.
deprecated Config presets like recommended and safe are now flat config only; old .eslintrc style presets removed. β
fix Use flat config format (eslint.config.js) with import.
gotcha The 'putout' rule internally uses Putout's engine; may conflict with other ESLint formatting rules. β
fix Disable conflicting rules (e.g., 'indent', 'max-len') if using putout/putout with fix:true.
gotcha Plugin must be imported as default export, not named exports like { rules }. β
fix Use 'import putout from "eslint-plugin-putout"' not 'import { putout } from "eslint-plugin-putout"'.
Install
npm install eslint-plugin-putout yarn add eslint-plugin-putout pnpm add eslint-plugin-putout Imports
- default
import putout from 'eslint-plugin-putout' - recommended
import { recommended } from 'eslint-plugin-putout' - safe wrong
const { safe } = require('eslint-plugin-putout')correctimport { safe } from 'eslint-plugin-putout'
Quickstart
// eslint.config.js
import putout from 'eslint-plugin-putout';
import { recommended } from 'eslint-plugin-putout';
import process from 'process';
export default [
...recommended,
{
plugins: { putout },
rules: {
'putout/putout': ['error', {
fix: true,
ignores: ['*.d.ts'],
regex: /\.(js|mjs)$/
}],
'putout/array-element-newline': 'error',
'putout/tape-add-newline-between-tests': 'error'
}
}
];