2.0.0 • Published 7 years ago
fixmyjs v2.0.0
fixmyjs
Meant to automatically fix your JavaScript errors in a non-destructive way.
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 camelCasecurly
- Adds curly braces to all statements that don't have themcurlyfor
- Adds curly braces only to for statementscurlyif
- Adds curly braces only to if/if-else statementscurlywhile
- Adds curly braces only to while statementsdebug
- Removes debugger statementsdecimals
- Adds a leading0
for decimals or removes trailing zero if decimal is wholedelete
- Removes deletion of variablesemptyStatement
- Removes empty statementseqeqeq
- Enforce strict equalityes3
- EnforcesparseIntRadix
as well asno-comma-dangle
hoist
- Hoists all your vars to the top of the functioninitUndefined
- Rewrites variable initializations to undefinedinvalidConstructor
- Does not allow you to initialize built-in primitive constructorsinvokeConstructors
- Adds()
to any new expressionsisNan
- Replaces equality to NaN with isNaNmultivar
- Replace single var with multi line varno-comma-dangle
- Removes trailing commasnonew
- Removes new when using it for side effectsonevar
- Make multi var into one varparseIntRadix
- Adds a radix parameter to parseIntplusplus
- Converts++
and--
to+= 1
||-= 1
rmdelete
- Removes the deletion of variablesrmempty
- Removes empty statementssnakecase
- Convert all identifiers to snake_casesub
- Dot notation conversionuseLiteral
- 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 enablesno-comma-dangle
as well as new optionparseIntRadix
.
License
2.0.0
7 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.13.7
10 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
12 years ago
0.7.2
12 years ago
0.7.1
12 years ago
0.6.5
13 years ago
0.6.2
13 years ago
0.6.0
13 years ago
0.5.5
13 years ago
0.5.1
13 years ago
0.5.0
13 years ago
0.4.5
13 years ago