Skip to content

Commit 8e05131

Browse files
committed
Added more jshint settings
1 parent 3395741 commit 8e05131

File tree

8 files changed

+193
-211
lines changed

8 files changed

+193
-211
lines changed

build/nunu.editor.min.js

Lines changed: 42 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/nunu.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/editor/nunu.editor.min.js

Lines changed: 42 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/editor/nunu.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/Nunu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Nunu.VERSION = "V0.9.1 Beta";
3636
* @attribute TIMESTAMP
3737
* @type {String}
3838
*/
39-
Nunu.TIMESTAMP = "201708250247";
39+
Nunu.TIMESTAMP = "201708251624";
4040

4141
/**
4242
* Check if host supports WebVR and if there is a VR display available.

source/config

Lines changed: 0 additions & 116 deletions
This file was deleted.

source/editor/Settings.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Settings.loadDefault = function()
2525
{
2626
//General
2727
Settings.general = {
28-
autoUpdate : true,
28+
autoUpdate : false,
2929
theme : "dark",
3030
filePreviewSize : 70,
3131
showStats : false,
@@ -92,48 +92,48 @@ Settings.loadDefault = function()
9292
bitwise : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
9393
curly : false, // true: Require {} for every new block or scope
9494
eqeqeq : false, // true: Require triple equals (===) for comparison
95-
forin : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
95+
forin : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
9696
freeze : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
9797
latedef : false, // true: Require variables/functions to be defined before being used
9898
noarg : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
9999
nonbsp : true, // true: Prohibit non-breaking whitespace characters.
100100
nonew : false, // true: Prohibit use of constructors for side-effects (without assignment)
101101
plusplus : false, // true: Prohibit use of `++` and `--`
102-
undef : true, // true: Require all non-global variables to be declared (prevents global leaks)
102+
undef : false, // true: Require all non-global variables to be declared (prevents global leaks)
103103
unused : true, // Unused variables:
104104
// true : all variables, last function parameter
105105
// "vars" : all variables only
106106
// "strict" : all variables, all function parameters
107-
strict : true, // true: Requires all functions run in ES5 Strict Mode
107+
strict : false, // true: Requires all functions run in ES5 Strict Mode
108108
maxparams : false, // {int} Max number of formal params allowed per function
109109
maxdepth : false, // {int} Max depth of nested blocks (within functions)
110110
maxstatements : false, // {int} Max number statements per function
111111
maxcomplexity : false, // {int} Max cyclomatic complexity per function
112112
varstmt : false, // true: Disallow any var statements. Only `let` and `const` are allowed.
113113

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

138138
//Environment
139139
browser : true, // Web Browser (window, document, etc)

source/editor/ui/tab/settings/JSHintSettingsTab.js

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function JSHintSettingsTab(parent, closeable, container, index)
5353
this.form.nextRow();
5454

5555
//For...in
56-
this.form.addText("for...in");
56+
this.form.addText("Filtering for...in");
5757
this.forin = new CheckBox(this.form.element);
5858
this.forin.size.set(15, 15);
5959
this.forin.setOnChange(function()
@@ -140,6 +140,86 @@ function JSHintSettingsTab(parent, closeable, container, index)
140140
this.form.add(this.undef);
141141
this.form.nextRow();
142142

143+
//Blank Space
144+
this.form.addText("");
145+
this.form.nextRow();
146+
147+
//Relaxing options
148+
this.form.addText("Relaxing Options");
149+
this.form.nextRow();
150+
151+
this.form.addText("Allow no semicolons");
152+
this.asi = new CheckBox(this.form.element);
153+
this.asi.size.set(15, 15);
154+
this.asi.setOnChange(function()
155+
{
156+
Settings.jslint.asi = self.asi.getValue();
157+
});
158+
this.form.add(this.asi);
159+
this.form.nextRow();
160+
161+
this.form.addText("Allow assign on comp.");
162+
this.boss = new CheckBox(this.form.element);
163+
this.boss.size.set(15, 15);
164+
this.boss.setOnChange(function()
165+
{
166+
Settings.jslint.boss = self.boss.getValue();
167+
});
168+
this.form.add(this.boss);
169+
this.form.nextRow();
170+
171+
this.form.addText("Allow debug stat.");
172+
this.debug = new CheckBox(this.form.element);
173+
this.debug.size.set(15, 15);
174+
this.debug.setOnChange(function()
175+
{
176+
Settings.jslint.debug = self.debug.getValue();
177+
});
178+
this.form.add(this.debug);
179+
this.form.nextRow();
180+
181+
this.form.addText("Allow == null");
182+
this.eqnull = new CheckBox(this.form.element);
183+
this.eqnull.size.set(15, 15);
184+
this.eqnull.setOnChange(function()
185+
{
186+
Settings.jslint.eqnull = self.eqnull.getValue();
187+
});
188+
this.form.add(this.eqnull);
189+
this.form.nextRow();
190+
191+
this.form.addText("ECMAScript Version");
192+
this.esversion = new DropdownList(this.form.element);
193+
this.esversion.size.set(50, 20);
194+
this.esversion.addValue(5, 5);
195+
this.esversion.addValue(6, 6);
196+
this.esversion.setOnChange(function()
197+
{
198+
Settings.jslint.esversion = self.esversion.getValue();
199+
});
200+
this.form.add(this.esversion);
201+
this.form.nextRow();
202+
203+
this.form.addText("Allow moz");
204+
this.moz = new CheckBox(this.form.element);
205+
this.moz.size.set(15, 15);
206+
this.moz.setOnChange(function()
207+
{
208+
Settings.jslint.moz = self.moz.getValue();
209+
});
210+
this.form.add(this.moz);
211+
this.form.nextRow();
212+
213+
this.form.addText("Allow eval");
214+
this.evil = new CheckBox(this.form.element);
215+
this.evil.size.set(15, 15);
216+
this.evil.setOnChange(function()
217+
{
218+
Settings.jslint.evil = self.evil.getValue();
219+
});
220+
this.form.add(this.evil);
221+
this.form.nextRow();
222+
143223
//Update form
144224
this.form.updateInterface();
145225
}
@@ -160,6 +240,14 @@ JSHintSettingsTab.prototype.activate = function()
160240
this.nonew.setValue(Settings.jslint.nonew);
161241
this.plusplus.setValue(Settings.jslint.plusplus);
162242
this.undef.setValue(Settings.jslint.undef);
243+
244+
this.asi.setValue(Settings.jslint.asi);
245+
this.boss.setValue(Settings.jslint.boss);
246+
this.debug.setValue(Settings.jslint.debug);
247+
this.eqnull.setValue(Settings.jslint.eqnull);
248+
this.esversion.setValue(Settings.jslint.esversion);
249+
this.moz.setValue(Settings.jslint.moz);
250+
this.evil.setValue(Settings.jslint.evil);
163251
};
164252

165253
//Update division Size

0 commit comments

Comments
 (0)