Lint Name
All, or at least most.
Code Snippet
for(var x;;);
Expected Result
error[no-inner-declarations]: Move variable declaration to module root
--> C:\...\test-script.js:1:5
|
1 | for(var x;;);
| ^^^^^
|
= help: Move the declaration up into the correct scope
Found 1 problem
Actual Result
error[no-inner-declarations]: Move variable declaration to module root
--> C:\...\test-script.js:1:5
|
1 | for(var x;;);
| ^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to module root
--> C:\...\test-script.js:1:5
|
1 | for(var x;;);
| ^^^^^
|
= help: Move the declaration up into the correct scope
Found 2 problems
Additional Info
This happens for almost all errors reported.
It's strange that this has not be noticed before. Perhaps this is unique to the Windows executable?
Just in case it helps to see more examples, I've added an additional, much larger, output from a module that is constrained to ES3 which produces a variety of linting errors (in part because it's been coded for easy transformation to ES2015+ as soon as we can get rid of a very old host-side JS runtime in production).
Version
dlint 0.6.0
Additional Results
C:\...\build\code>cls & dlint run --config=C:\...\build\$DenoLintRules.json C:\...\business\code\libweb\src\util\GeneralUtil.js
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:90:9
|
90 | for(var xa=0; xa<fncs.length; ++xa) {
| ^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:90:9
|
90 | for(var xa=0; xa<fncs.length; ++xa) {
| ^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:99:17
|
99 | for(var xa=0,len=fncs.length; xa<len; ++xa) { fncs[xa].apply(null,args); }
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:99:17
|
99 | for(var xa=0,len=fncs.length; xa<len; ++xa) { fncs[xa].apply(null,args); }
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:189:17
|
189 | for(var xa=0,len=cmpfncs.length; xa<len && cmpres==0; ++xa) { cmpres=cmpfncs[xa](onercd,tworcd); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:189:17
|
189 | for(var xa=0,len=cmpfncs.length; xa<len && cmpres==0; ++xa) { cmpres=cmpfncs[xa](onercd,tworcd); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-extra-semi]: Unnecessary semicolon.
--> C:\...\src\util\GeneralUtil.js:230:10
|
230 | };
| ^
|
= help: Remove the extra (and unnecessary) semi-colon
error[no-extra-semi]: Unnecessary semicolon.
--> C:\...\src\util\GeneralUtil.js:230:10
|
230 | };
| ^
|
= help: Remove the extra (and unnecessary) semi-colon
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:252:9
|
252 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:252:9
|
252 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:253:13
|
253 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:253:13
|
253 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:254:9
|
254 | var val=obj[key];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:254:9
|
254 | var val=obj[key];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:299:9
|
299 | for(var dft of argsArray(arguments,1)) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:299:9
|
299 | for(var dft of argsArray(arguments,1)) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:328:9
|
328 | var args=argsArray(arguments,2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:328:9
|
328 | var args=argsArray(arguments,2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:344:13
|
344 | for(var xa=0, len=arr.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:344:13
|
344 | for(var xa=0, len=arr.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:417:21
|
417 | if(exctyps) for(var xa=0,len=exctyps.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:417:21
|
417 | if(exctyps) for(var xa=0,len=exctyps.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:489:9
|
489 | for(var xa=1,len=arguments.length; xa<len; ++xa ) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:489:9
|
489 | for(var xa=1,len=arguments.length; xa<len; ++xa ) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:515:9
|
515 | for(var xa=1,len=arguments.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:515:9
|
515 | for(var xa=1,len=arguments.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:517:13
|
517 | for(var keys=Object.keys(src), xb=0; xb<keys.length; xb++) { var key=keys[xb]; tgt[key]=src[key]; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:517:70
|
517 | for(var keys=Object.keys(src), xb=0; xb<keys.length; xb++) { var key=keys[xb]; tgt[key]=src[key]; }
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:517:13
|
517 | for(var keys=Object.keys(src), xb=0; xb<keys.length; xb++) { var key=keys[xb]; tgt[key]=src[key]; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:517:70
|
517 | for(var keys=Object.keys(src), xb=0; xb<keys.length; xb++) { var key=keys[xb]; tgt[key]=src[key]; }
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:565:9
|
565 | for(var xa=1,len=arguments.length; xa<len; ++xa ) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:565:9
|
565 | for(var xa=1,len=arguments.length; xa<len; ++xa ) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-extra-semi]: Unnecessary semicolon.
--> C:\...\src\util\GeneralUtil.js:634:10
|
634 | };
| ^
|
= help: Remove the extra (and unnecessary) semi-colon
error[no-extra-semi]: Unnecessary semicolon.
--> C:\...\src\util\GeneralUtil.js:634:10
|
634 | };
| ^
|
= help: Remove the extra (and unnecessary) semi-colon
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:640:9
|
640 | var stgval=localStorage.getItem(stgnam);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:640:9
|
640 | var stgval=localStorage.getItem(stgnam);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-empty]: Empty block statement
--> C:\...\src\util\GeneralUtil.js:642:75
|
642 | try { curval=JSON.parse(stgval).value || curval; } catch(err) {} // ignore error, leaving current value unchanged
| ^^
|
= help: Add code or comment to the empty block
error[no-empty]: Empty block statement
--> C:\...\src\util\GeneralUtil.js:642:75
|
642 | try { curval=JSON.parse(stgval).value || curval; } catch(err) {} // ignore error, leaving current value unchanged
| ^^
|
= help: Add code or comment to the empty block
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:646:9
|
646 | var inival=curval;
| ^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:646:9
|
646 | var inival=curval;
| ^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:780:9
|
780 | for(var xa=0,len=pths.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:780:9
|
780 | for(var xa=0,len=pths.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:781:9
|
781 | var pth=pths[xa];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:781:9
|
781 | var pth=pths[xa];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:782:9
|
782 | var spl=pth.lastIndexOf("/");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:782:9
|
782 | var spl=pth.lastIndexOf("/");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:783:9
|
783 | var par,lea;
| ^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:783:9
|
783 | var par,lea;
| ^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:839:9
|
839 | var args=argsArray(arguments,1); // include `fnc` which will become the current count
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:839:9
|
839 | var args=argsArray(arguments,1); // include `fnc` which will become the current count
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:842:13
|
842 | var lmt=cnt;
| ^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:842:13
|
842 | var lmt=cnt;
| ^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:845:13
|
845 | for(var xa=0; cnt(xa); ++xa) {
| ^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:845:13
|
845 | for(var xa=0; cnt(xa); ++xa) {
| ^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:986:9
|
986 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:986:9
|
986 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:987:13
|
987 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:987:13
|
987 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:988:9
|
988 | var val=obj[key];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:988:9
|
988 | var val=obj[key];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:998:13
|
998 | for(var xa=0,len=srcobj.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:998:13
|
998 | for(var xa=0,len=srcobj.length; xa<len; ++xa) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:999:13
|
999 | var srcval=srcobj[xa];
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:999:13
|
999 | var srcval=srcobj[xa];
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1016:13
|
1016 | for(var key in srcobj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1016:13
|
1016 | for(var key in srcobj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:1017:17
|
1017 | if(!srcobj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:1017:17
|
1017 | if(!srcobj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1018:13
|
1018 | var srcval=srcobj[key];
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-redeclare]: Redeclaration is not allowed
--> C:\...\src\util\GeneralUtil.js:1018:17
|
1018 | var srcval=srcobj[key];
| ^^^^^^
|
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1018:13
|
1018 | var srcval=srcobj[key];
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-redeclare]: Redeclaration is not allowed
--> C:\...\src\util\GeneralUtil.js:1018:17
|
1018 | var srcval=srcobj[key];
| ^^^^^^
|
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1040:9
|
1040 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1040:9
|
1040 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:1041:13
|
1041 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:1041:13
|
1041 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1042:9
|
1042 | var val=obj[key];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1042:9
|
1042 | var val=obj[key];
| ^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1054:9
|
1054 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1054:9
|
1054 | for(var key in obj) {
| ^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:1055:13
|
1055 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-prototype-builtins]: Access to Object.prototype.hasOwnProperty is not allowed from target object
--> C:\...\src\util\GeneralUtil.js:1055:13
|
1055 | if(!obj.hasOwnProperty(key)) { continue; }
| ^^^^^^^^^^^^^^^^^^^^^^^
|
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1056:9
|
1056 | var val = obj[key];
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
error[no-inner-declarations]: Move variable declaration to function root
--> C:\...\src\util\GeneralUtil.js:1056:9
|
1056 | var val = obj[key];
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: Move the declaration up into the correct scope
Found 84 problems
C:\...\build\code>
bug