Registry / testing / fixmyjs

fixmyjs

JSON →
library2.0.0jsnpmunverified

fixmyjs automatically fixes JavaScript code based on lint rules from JSHint/JSLint. Version 2.0.0 is latest stable, with no active development since 2016. It applies transformations like adding curly braces, converting to strict equality, hoisting vars, and more. Unlike ESLint's --fix, it works as a separate CLI tool or library. Maintenance mode: critically depends on unmaintained JSHint.

npm install fixmyjs
INSTALL
IMPORT
SIG · FIXMYJS
F
fixmyjs
testingjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

fix
✓ import { fix } from 'fixmyjs'
✗ const fix = require('fixmyjs')
ESM import is correct; CommonJS require gives a function, not an object.
default import
✓ import fixmyjs from 'fixmyjs'; const result = fixmyjs.fix(code, options);
✗ import { default as fixmyjs } from 'fixmyjs'
Default import gives an object with fix method.
TypeScript type
✓ import type { FixOptions } from 'fixmyjs'
✗ import { FixOptions } from 'fixmyjs'
Types are not shipped; use @types/fixmyjs or declare module.

Demonstrates programmatic usage: fixes code by converting == to === and ++ to +=1.

import { fix } from 'fixmyjs'; const code = 'var x = 1; if (x == 1) { x++; }'; const options = { eqeqeq: true, plusplus: true }; const fixed = fix(code, options); console.log(fixed); // 'var x = 1; if (x === 1) { x += 1; }'
fixmyjs --version
Debug
Known issues
breakingLegacy mode removed in v2.0
fix
Use config in package.json instead of legacy options.
affects: >=2.0
breakingAll rules now truthy in v2.0
fix
Set rules to true instead of false to enable; check default config in package.json.
affects: >=2.0
deprecatedPackage is unmaintained since 2016
fix
Consider using ESLint --fix or prettier instead.
affects: >=0.1.0
gotchaCLI tool requires global install
fix
Run `npm install -g fixmyjs` before using `fixmyjs your_file.js`.
affects: >=0.1.0
gotchafix function mutates input options object
fix
Clone options before passing: fix(code, {...options}).
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'fixmyjs'
Package not installed or not in node_modules
fix
Run `npm install fixmyjs`.
TypeError: fixmyjs.fix is not a function
Used CommonJS require instead of ESM import (fixmyjs v2+ is ESM-only).
fix
Use `import { fix } from 'fixmyjs'` or `import fixmyjs from 'fixmyjs'` then `fixmyjs.fix(...)`.
fixmyjs: command not found
CLI not installed globally or not in PATH
fix
Run `npm install -g fixmyjs`.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
jshintrequiredUses JSHint configuration and lint rules
Agent activity
4 hits · last 30 days
node
4
Resources
fixmyjs — npm install fixmyjs · libregistry