Skip to content

Commit

Permalink
Added more jshint settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed Aug 25, 2017
1 parent 3395741 commit 8e05131
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 211 deletions.
79 changes: 42 additions & 37 deletions build/nunu.editor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/nunu.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 42 additions & 37 deletions docs/editor/nunu.editor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/editor/nunu.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/Nunu.js
Expand Up @@ -36,7 +36,7 @@ Nunu.VERSION = "V0.9.1 Beta";
* @attribute TIMESTAMP
* @type {String}
*/
Nunu.TIMESTAMP = "201708250247";
Nunu.TIMESTAMP = "201708251624";

/**
* Check if host supports WebVR and if there is a VR display available.
Expand Down
116 changes: 0 additions & 116 deletions source/config

This file was deleted.

34 changes: 17 additions & 17 deletions source/editor/Settings.js
Expand Up @@ -25,7 +25,7 @@ Settings.loadDefault = function()
{
//General
Settings.general = {
autoUpdate : true,
autoUpdate : false,
theme : "dark",
filePreviewSize : 70,
showStats : false,
Expand Down Expand Up @@ -92,48 +92,48 @@ Settings.loadDefault = function()
bitwise : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
curly : false, // true: Require {} for every new block or scope
eqeqeq : false, // true: Require triple equals (===) for comparison
forin : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
forin : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
freeze : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
latedef : false, // true: Require variables/functions to be defined before being used
noarg : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
nonbsp : true, // true: Prohibit non-breaking whitespace characters.
nonew : false, // true: Prohibit use of constructors for side-effects (without assignment)
plusplus : false, // true: Prohibit use of `++` and `--`
undef : true, // true: Require all non-global variables to be declared (prevents global leaks)
undef : false, // true: Require all non-global variables to be declared (prevents global leaks)
unused : true, // Unused variables:
// true : all variables, last function parameter
// "vars" : all variables only
// "strict" : all variables, all function parameters
strict : true, // true: Requires all functions run in ES5 Strict Mode
strict : false, // true: Requires all functions run in ES5 Strict Mode
maxparams : false, // {int} Max number of formal params allowed per function
maxdepth : false, // {int} Max depth of nested blocks (within functions)
maxstatements : false, // {int} Max number statements per function
maxcomplexity : false, // {int} Max cyclomatic complexity per function
varstmt : false, // true: Disallow any var statements. Only `let` and `const` are allowed.

//Relaxing
asi : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
boss : false, // true: Tolerate assignments where comparisons would be expected
debug : false, // true: Allow debugger statements e.g. browser breakpoints.
asi : true, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
boss : true, // true: Tolerate assignments where comparisons would be expected
debug : true, // true: Allow debugger statements e.g. browser breakpoints.
eqnull : true, // true: Tolerate use of `== null`
esversion : 6, // {int} Specify the ECMAScript version to which the code must adhere.
moz : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
moz : true, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
evil : true, // true: Tolerate use of `eval` and `new Function()`
expr : false, // true: Tolerate `ExpressionStatement` as Programs
funcscope : false, // true: Tolerate defining variables inside control statements
iterator : false, // true: Tolerate using the `__iterator__` property
lastsemic : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
expr : true, // true: Tolerate `ExpressionStatement` as Programs
funcscope : true, // true: Tolerate defining variables inside control statements
iterator : true, // true: Tolerate using the `__iterator__` property
lastsemic : true, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
laxbreak : false, // true: Tolerate possibly unsafe line breakings
loopfunc : false, // true: Tolerate functions being defined in loops
loopfunc : true, // true: Tolerate functions being defined in loops
noyield : false, // true: Tolerate generator functions with no yield statement in them.
notypeof : false, // true: Tolerate invalid typeof operator values
proto : false, // true: Tolerate using the `__proto__` property
notypeof : true, // true: Tolerate invalid typeof operator values
proto : true, // true: Tolerate using the `__proto__` property
scripturl : false, // true: Tolerate script-targeted URLs
shadow : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
shadow : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
sub : true, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
supernew : true, // true: Tolerate `new function () { ... };` and `new Object;`
validthis : false, // true: Tolerate using this in a non-constructor function
validthis : true, // true: Tolerate using this in a non-constructor function

//Environment
browser : true, // Web Browser (window, document, etc)
Expand Down
90 changes: 89 additions & 1 deletion source/editor/ui/tab/settings/JSHintSettingsTab.js
Expand Up @@ -53,7 +53,7 @@ function JSHintSettingsTab(parent, closeable, container, index)
this.form.nextRow();

//For...in
this.form.addText("for...in");
this.form.addText("Filtering for...in");
this.forin = new CheckBox(this.form.element);
this.forin.size.set(15, 15);
this.forin.setOnChange(function()
Expand Down Expand Up @@ -140,6 +140,86 @@ function JSHintSettingsTab(parent, closeable, container, index)
this.form.add(this.undef);
this.form.nextRow();

//Blank Space
this.form.addText("");
this.form.nextRow();

//Relaxing options
this.form.addText("Relaxing Options");
this.form.nextRow();

this.form.addText("Allow no semicolons");
this.asi = new CheckBox(this.form.element);
this.asi.size.set(15, 15);
this.asi.setOnChange(function()
{
Settings.jslint.asi = self.asi.getValue();
});
this.form.add(this.asi);
this.form.nextRow();

this.form.addText("Allow assign on comp.");
this.boss = new CheckBox(this.form.element);
this.boss.size.set(15, 15);
this.boss.setOnChange(function()
{
Settings.jslint.boss = self.boss.getValue();
});
this.form.add(this.boss);
this.form.nextRow();

this.form.addText("Allow debug stat.");
this.debug = new CheckBox(this.form.element);
this.debug.size.set(15, 15);
this.debug.setOnChange(function()
{
Settings.jslint.debug = self.debug.getValue();
});
this.form.add(this.debug);
this.form.nextRow();

this.form.addText("Allow == null");
this.eqnull = new CheckBox(this.form.element);
this.eqnull.size.set(15, 15);
this.eqnull.setOnChange(function()
{
Settings.jslint.eqnull = self.eqnull.getValue();
});
this.form.add(this.eqnull);
this.form.nextRow();

this.form.addText("ECMAScript Version");
this.esversion = new DropdownList(this.form.element);
this.esversion.size.set(50, 20);
this.esversion.addValue(5, 5);
this.esversion.addValue(6, 6);
this.esversion.setOnChange(function()
{
Settings.jslint.esversion = self.esversion.getValue();
});
this.form.add(this.esversion);
this.form.nextRow();

this.form.addText("Allow moz");
this.moz = new CheckBox(this.form.element);
this.moz.size.set(15, 15);
this.moz.setOnChange(function()
{
Settings.jslint.moz = self.moz.getValue();
});
this.form.add(this.moz);
this.form.nextRow();

this.form.addText("Allow eval");
this.evil = new CheckBox(this.form.element);
this.evil.size.set(15, 15);
this.evil.setOnChange(function()
{
Settings.jslint.evil = self.evil.getValue();
});
this.form.add(this.evil);
this.form.nextRow();

//Update form
this.form.updateInterface();
}
Expand All @@ -160,6 +240,14 @@ JSHintSettingsTab.prototype.activate = function()
this.nonew.setValue(Settings.jslint.nonew);
this.plusplus.setValue(Settings.jslint.plusplus);
this.undef.setValue(Settings.jslint.undef);

this.asi.setValue(Settings.jslint.asi);
this.boss.setValue(Settings.jslint.boss);
this.debug.setValue(Settings.jslint.debug);
this.eqnull.setValue(Settings.jslint.eqnull);
this.esversion.setValue(Settings.jslint.esversion);
this.moz.setValue(Settings.jslint.moz);
this.evil.setValue(Settings.jslint.evil);
};

//Update division Size
Expand Down

0 comments on commit 8e05131

Please sign in to comment.