{"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,"search_vec":"'2.0.0':14 '2016':23 'activ':20 'ad':28 'appli':25 'automat':3 'base':7 'beautifi':60 'brace':30 'cli':48 'code':6 'convert':31 'critic':54 'cur':29 'depend':55 'develop':21 'equal':34 'eslint':40 'fix':4,42 'fixmyj':1,2 'hint':61 'hoist':35 'javascript':5,59 'jshint':58,62 'jshint/jslint':12 'jslint':63 'latest':16 'librari':51 'like':27 'lint':9,64 'mainten':52 'mode':53 'rule':10 'separ':47 'sinc':22 'stabl':17 'strict':33 'tool':49 'transform':26 'unlik':39 'unmaintain':57 'var':36 'version':13 'work':44","created_at":"2026-05-01T13:45:32.787437+00:00","updated_at":"2026-05-01T13:45:32.787437+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"fixmyjs","cli_version":null,"type":"library","homepage":"http://fixmyjs.com","github":"https://github.com/jshint/fixmyjs","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/fixmyjs","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}