Registry / devops / eslint-transforms

eslint-transforms

JSON →
library3.0.0jsnpmunverified

A collection of jscodeshift-based codemods for automating ESLint rule upgrades across major versions. Current stable version is 3.0.0, released June 2024. Active development with recent transforms for ESLint v9 migration. Key differentiator: provides automated transforms for rule format changes (new-rule-format, v9-rule-migration) that would otherwise require manual refactoring. Requires Node >=20 and jscodeshift as a peer dependency. Alternative to manual upgrading or using ESLint's built-in migration tools.

npm install eslint-transforms
INSTALL
IMPORT
SIG · ESLINT-TRANSFORMS
E
eslint-transforms
devopsjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eslint-transforms CLI
npx eslint-transforms <transform-name> <path>
npm run eslint-transforms (unless configured in package.json)
CLI is the primary usage; no JavaScript import needed. Use npx for direct execution.
default import (if used programmatically)
import eslintTransforms from 'eslint-transforms'
const eslintTransforms = require('eslint-transforms')
Package is ESM-only since v3. CommonJS require will fail. Programmatic usage is undocumented but possible.
transform functions
import { newRuleFormat, v9RuleMigration } from 'eslint-transforms'
const newRuleFormat = require('eslint-transforms').newRuleFormat
Individual transforms are exported as named exports. Check package for actual export names.

Install the package as a dev dependency and run the v9-rule-migration transform on a rules directory, then new-rule-format on legacy rules.

npm install eslint-transforms --save-dev npx eslint-transforms v9-rule-migration ./lib/rules npx eslint-transforms new-rule-format ./legacy-rules
eslint-transforms --version
Debug
Known issues
breakingNode.js >=20 required. Older versions unsupported.
fix
Upgrade Node.js to v20 or higher.
affects: >=3.0.0
breakingESM-only from v3.0.0. CommonJS require() will fail.
fix
Use ESM imports or ensure compatibility with ESM modules.
affects: >=3.0.0
gotchaThe new-rule-format transform does not work for rules using ES6 module syntax.
fix
Convert ES6 modules to CommonJS before running the transform, or manually update the rule.
affects: all
gotchaTransforms modify files in-place. No undo mechanism provided.
fix
Commit changes or use version control before running transforms. Use --dry flag if available (check docs).
affects: all
breakingDrop support for Node <12 in v2.0.0.
fix
Upgrade to Node >=12 to use v2+, or stay on v1.x if stuck on older Node.
affects: <2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-transforms'
Package not installed or incorrect import path.
fix
Run `npm install eslint-transforms --save-dev`. If using ESM, ensure package.json has type: module or use .mjs extension.
Error [ERR_REQUIRE_ESM]: require() of ES Module ... from ... not supported.
Using CommonJS require() with ESM-only package (v3+).
fix
Switch to ESM imports: `import eslintTransforms from 'eslint-transforms'` or convert your script to ESM.
TypeError: eslintTransforms is not a function
Incorrect usage: attempting to call the package as a function instead of using CLI or named exports.
fix
Use CLI: `npx eslint-transforms v9-rule-migration <path>`. Or import named transform functions.
Error: Node.js version 14 is not supported.
Running on Node <20 with v3.0.0.
fix
Upgrade Node to v20 or higher. If unable, use v2.x with Node 12+ by pinning version: `npm install eslint-transforms@2`.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-transforms — npm install eslint-transforms · libregistry