2.0.0 • Published 7 years ago

fixmyjs v2.0.0

Weekly downloads
557
License
MIT
Repository
github
Last release
7 years ago

fixmyjs

Join the chat at https://gitter.im/jshint/fixmyjs

Meant to automatically fix your JavaScript errors in a non-destructive way.

Build Status Coverage Status NPM version Dependency Status devDependency Status Download Count

Installing

npm install fixmyjs -g

Usage

fixmyjs your_file.js

Programatically

var fixmyjs = require('fixmyjs')
var stringFixedCode = fixmyjs.fix(stringOfCode, objectOfOptions)

Tools

Options

When the options are set to true they are enabled. To get a breakdown of what is enabled by default check out package.json

  • camelcase - Converts all identifiers to camelCase
  • curly - Adds curly braces to all statements that don't have them
  • curlyfor - Adds curly braces only to for statements
  • curlyif - Adds curly braces only to if/if-else statements
  • curlywhile - Adds curly braces only to while statements
  • debug - Removes debugger statements
  • decimals - Adds a leading 0 for decimals or removes trailing zero if decimal is whole
  • delete - Removes deletion of variables
  • emptyStatement - Removes empty statements
  • eqeqeq - Enforce strict equality
  • es3 - Enforces parseIntRadix as well as no-comma-dangle
  • hoist - Hoists all your vars to the top of the function
  • initUndefined - Rewrites variable initializations to undefined
  • invalidConstructor - Does not allow you to initialize built-in primitive constructors
  • invokeConstructors - Adds () to any new expressions
  • isNan - Replaces equality to NaN with isNaN
  • multivar - Replace single var with multi line var
  • no-comma-dangle - Removes trailing commas
  • nonew - Removes new when using it for side effects
  • onevar - Make multi var into one var
  • parseIntRadix - Adds a radix parameter to parseInt
  • plusplus - Converts ++ and -- to += 1 || -= 1
  • rmdelete - Removes the deletion of variables
  • rmempty - Removes empty statements
  • snakecase - Convert all identifiers to snake_case
  • sub - Dot notation conversion
  • useLiteral - Rewrites your primitives to use their literal form

Breaking Changes in 2.0

  • Legacy mode has been removed.
  • You now put your config inside package.json. You can check out an example in this project.
  • All rules have been made truthy because having some rules be truthy and others falsy is weird.
  • Option es3 now enables no-comma-dangle as well as new option parseIntRadix.

License

MIT

2.0.0

7 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.13.7

9 years ago

0.13.6

10 years ago

0.13.5

10 years ago

0.13.4

10 years ago

0.13.3

10 years ago

0.13.2

10 years ago

0.13.1

11 years ago

0.13.0

11 years ago

0.11.0

11 years ago

0.10.6

11 years ago

0.10.5

11 years ago

0.10.4

11 years ago

0.10.3

11 years ago

0.10.2

11 years ago

0.10.1

11 years ago

0.10.0

11 years ago

0.9.2

11 years ago

0.9.1

11 years ago

0.9.0

11 years ago

0.7.4

11 years ago

0.7.3

11 years ago

0.7.2

12 years ago

0.7.1

12 years ago

0.6.5

12 years ago

0.6.2

12 years ago

0.6.0

12 years ago

0.5.5

12 years ago

0.5.1

12 years ago

0.5.0

12 years ago

0.4.5

12 years ago