Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fixmyjs

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fixmyjs

Automatically fixes your JavaScript based on lint rules

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by32.65%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 29 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc