{"id":25590,"library":"fixmyjs","title":"fixmyjs","description":"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.","status":"maintenance","version":"2.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/jshint/fixmyjs","tags":["javascript","beautify","hint","jshint","jslint","lint"],"install":[{"cmd":"npm install fixmyjs","lang":"bash","label":"npm"},{"cmd":"yarn add fixmyjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add fixmyjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Uses JSHint configuration and lint rules","package":"jshint","optional":false}],"imports":[{"note":"ESM import is correct; CommonJS require gives a function, not an object.","wrong":"const fix = require('fixmyjs')","symbol":"fix","correct":"import { fix } from 'fixmyjs'"},{"note":"Default import gives an object with fix method.","wrong":"import { default as fixmyjs } from 'fixmyjs'","symbol":"default import","correct":"import fixmyjs from 'fixmyjs';\nconst result = fixmyjs.fix(code, options);"},{"note":"Types are not shipped; use @types/fixmyjs or declare module.","wrong":"import { FixOptions } from 'fixmyjs'","symbol":"TypeScript type","correct":"import type { FixOptions } from 'fixmyjs'"}],"quickstart":{"code":"import { fix } from 'fixmyjs';\nconst code = 'var x = 1; if (x == 1) { x++; }';\nconst options = { eqeqeq: true, plusplus: true };\nconst fixed = fix(code, options);\nconsole.log(fixed); // 'var x = 1; if (x === 1) { x += 1; }'","lang":"javascript","description":"Demonstrates programmatic usage: fixes code by converting == to === and ++ to +=1."},"warnings":[{"fix":"Use config in package.json instead of legacy options.","message":"Legacy mode removed in v2.0","severity":"breaking","affected_versions":">=2.0"},{"fix":"Set rules to true instead of false to enable; check default config in package.json.","message":"All rules now truthy in v2.0","severity":"breaking","affected_versions":">=2.0"},{"fix":"Consider using ESLint --fix or prettier instead.","message":"Package is unmaintained since 2016","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Run `npm install -g fixmyjs` before using `fixmyjs your_file.js`.","message":"CLI tool requires global install","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Clone options before passing: fix(code, {...options}).","message":"fix function mutates input options object","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install fixmyjs`.","cause":"Package not installed or not in node_modules","error":"Cannot find module 'fixmyjs'"},{"fix":"Use `import { fix } from 'fixmyjs'` or `import fixmyjs from 'fixmyjs'` then `fixmyjs.fix(...)`.","cause":"Used CommonJS require instead of ESM import (fixmyjs v2+ is ESM-only).","error":"TypeError: fixmyjs.fix is not a function"},{"fix":"Run `npm install -g fixmyjs`.","cause":"CLI not installed globally or not in PATH","error":"fixmyjs: command not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}