You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by au...@apache.org on 2017/08/29 23:34:34 UTC

[1/5] cordova-plugin-file git commit: CB-12895 : setup eslint and took out jshint

Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master b514aaf40 -> 07557e02a


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/readEntries.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readEntries.js b/www/blackberry10/readEntries.js
index 6dcb6da..667ea3c 100644
--- a/www/blackberry10/readEntries.js
+++ b/www/blackberry10/readEntries.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * readEntries
- * 
+ *
  * IN:
  *  args
  *   0 - URL of directory to list
@@ -30,40 +30,42 @@
  *  fail - FileError
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame'),
-    createEntryFromNative = cordova.require('cordova-plugin-file.bb10CreateEntryFromNative');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+var createEntryFromNative = cordova.require('cordova-plugin-file.bb10CreateEntryFromNative');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
-            var reader = fs.nativeEntry.createReader(),
-                entries = [],
-                readEntries = function() {
-                    reader.readEntries(function (results) {
-                        if (!results.length) {
-                            onSuccess(entries.sort().map(createEntryFromNative));
-                        } else {
-                            entries = entries.concat(Array.prototype.slice.call(results || [], 0));
-                            readEntries();
-                        }
-                    }, onFail);
-                };
+            var reader = fs.nativeEntry.createReader();
+            var entries = [];
+            var readEntries = function () {
+                reader.readEntries(function (results) {
+                    if (!results.length) {
+                        onSuccess(entries.sort().map(createEntryFromNative));
+                    } else {
+                        entries = entries.concat(Array.prototype.slice.call(results || [], 0));
+                        readEntries();
+                    }
+                }, onFail);
+            };
             readEntries();
         });
     }, fail, [uri]);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/remove.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/remove.js b/www/blackberry10/remove.js
index 7932da6..bfbe102 100644
--- a/www/blackberry10/remove.js
+++ b/www/blackberry10/remove.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * remove
- * 
+ *
  * IN:
  *  args
  *   0 - URL of Entry to remove
@@ -30,29 +30,31 @@
  *  fail - FileError
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             if (fs.fullPath === '/') {
-                onFail(FileError.NO_MODIFICATION_ALLOWED_ERR);
+                onFail(FileError.NO_MODIFICATION_ALLOWED_ERR); // eslint-disable-line no-undef
             } else {
                 fs.nativeEntry.remove(onSuccess, onFail);
             }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/removeRecursively.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/removeRecursively.js b/www/blackberry10/removeRecursively.js
index fe01a67..29d8a73 100644
--- a/www/blackberry10/removeRecursively.js
+++ b/www/blackberry10/removeRecursively.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * removeRecursively
- * 
+ *
  * IN:
  *  args
  *   0 - URL of DirectoryEntry to remove recursively
@@ -30,33 +30,35 @@
  *  fail - FileError
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error.code) {
-                    if (error.code === FileError.INVALID_MODIFICATION_ERR) {
-                        //mobile-spec expects this error code
-                        fail(FileError.NO_MODIFICATION_ALLOWED_ERR);
-                    } else {
-                        fail(error.code);
-                    }
+    var uri = args[0];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error.code) {
+                if (error.code === FileError.INVALID_MODIFICATION_ERR) { // eslint-disable-line no-undef
+                    // mobile-spec expects this error code
+                    fail(FileError.NO_MODIFICATION_ALLOWED_ERR); // eslint-disable-line no-undef
                 } else {
-                    fail(error);
+                    fail(error.code);
                 }
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             fs.nativeEntry.removeRecursively(onSuccess, onFail);
-        }); 
+        });
     }, fail, [uri]);
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/requestAllFileSystems.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/requestAllFileSystems.js b/www/blackberry10/requestAllFileSystems.js
index d023beb..1cbae40 100644
--- a/www/blackberry10/requestAllFileSystems.js
+++ b/www/blackberry10/requestAllFileSystems.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * requestAllFileSystems
- * 
+ *
  * IN - no arguments
  * OUT
  *  success - Array of FileSystems

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/requestAnimationFrame.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/requestAnimationFrame.js b/www/blackberry10/requestAnimationFrame.js
index aac0a4a..b4274d5 100644
--- a/www/blackberry10/requestAnimationFrame.js
+++ b/www/blackberry10/requestAnimationFrame.js
@@ -21,18 +21,18 @@
 
 /*
  * requestAnimationFrame
- * 
+ *
  * This is used throughout the BB10 File implementation to wrap
  * native webkit calls. There is a bug in the webkit implementation
  * which causes callbacks to never return when multiple file system
  * APIs are called in sequence. This should also make the UI more
  * responsive during file operations.
- * 
+ *
  * Supported on BB10 OS > 10.1
  */
 
 var requestAnimationFrame = window.requestAnimationFrame;
-if (typeof(requestAnimationFrame) !== 'function') {
+if (typeof (requestAnimationFrame) !== 'function') {
     requestAnimationFrame = function (cb) { cb(); };
 }
 module.exports = requestAnimationFrame;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/requestFileSystem.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/requestFileSystem.js b/www/blackberry10/requestFileSystem.js
index 489e510..616c93d 100644
--- a/www/blackberry10/requestFileSystem.js
+++ b/www/blackberry10/requestFileSystem.js
@@ -19,11 +19,11 @@
  *
 */
 
-/* 
+/*
  * requestFileSystem
  *
  * IN:
- *  args 
+ *  args
  *   0 - type (TEMPORARY = 0, PERSISTENT = 1)
  *   1 - size
  * OUT:
@@ -37,17 +37,17 @@
  *  fail - FileError code
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'); // eslint-disable-line no-undef
 
 module.exports = function (success, fail, args) {
-    var fsType = args[0] === 0 ? 'temporary' : 'persistent',
-        size = args[1],
-        onSuccess = function (fs) {
-            var directory = {
-                name: fsType,
-                root: fs
-            };
-            success(directory);
+    var fsType = args[0] === 0 ? 'temporary' : 'persistent';
+    var size = args[1];
+    var onSuccess = function (fs) {
+        var directory = {
+            name: fsType,
+            root: fs
         };
+        success(directory);
+    };
     resolve(onSuccess, fail, ['cdvfile://localhost/' + fsType + '/', undefined, size]);
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/resolveLocalFileSystemURI.js b/www/blackberry10/resolveLocalFileSystemURI.js
index 5e82b5b..ba8795a 100644
--- a/www/blackberry10/resolveLocalFileSystemURI.js
+++ b/www/blackberry10/resolveLocalFileSystemURI.js
@@ -38,30 +38,30 @@
  *  fail - FileError code
  */
 
-var info = require('cordova-plugin-file.bb10FileSystemInfo'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame'),
-    createEntryFromNative = require('cordova-plugin-file.bb10CreateEntryFromNative'),
-    SANDBOXED = true,
-    UNSANDBOXED = false;
+var info = require('cordova-plugin-file.bb10FileSystemInfo');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame'); // eslint-disable-line no-undef
+var createEntryFromNative = require('cordova-plugin-file.bb10CreateEntryFromNative');
+var SANDBOXED = true;
+var UNSANDBOXED = false;
 
 module.exports = function (success, fail, args) {
-    var request = args[0],
-        options = args[1],
-        size = args[2];
+    var request = args[0];
+    var options = args[1];
+    var size = args[2];
     if (request) {
         request = decodeURIComponent(request);
         if (request.indexOf('?') > -1) {
-            //bb10 does not support params; strip them off
+            // bb10 does not support params; strip them off
             request = request.substring(0, request.indexOf('?'));
         }
         if (request.indexOf('file://localhost/') === 0) {
-            //remove localhost prefix
+            // remove localhost prefix
             request = request.replace('file://localhost/', 'file:///');
         }
-        //requests to sandboxed locations should use cdvfile
+        // requests to sandboxed locations should use cdvfile
         request = request.replace(info.persistentPath, 'cdvfile://localhost/persistent');
         request = request.replace(info.temporaryPath, 'cdvfile://localhost/temporary');
-        //pick appropriate handler
+        // pick appropriate handler
         if (request.indexOf('file:///') === 0) {
             resolveFile(success, fail, request, options);
         } else if (request.indexOf('cdvfile://localhost/') === 0) {
@@ -69,57 +69,54 @@ module.exports = function (success, fail, args) {
         } else if (request.indexOf('local:///') === 0) {
             resolveLocal(success, fail, request, options);
         } else {
-            fail(FileError.ENCODING_ERR);
+            fail(FileError.ENCODING_ERR); // eslint-disable-line no-undef
         }
     } else {
-        fail(FileError.NOT_FOUND_ERR);
+        fail(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
     }
 };
 
-//resolve file:///
-function resolveFile(success, fail, request, options) {
+// resolve file:///
+function resolveFile (success, fail, request, options) {
     var path = request.substring(7);
     resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
 }
 
-//resolve cdvfile://localhost/filesystemname/
-function resolveCdvFile(success, fail, request, options, size) {
-    var components = /cdvfile:\/\/localhost\/([^\/]+)\/(.*)/.exec(request),
-        fsType = components[1],
-        path = components[2];
+// resolve cdvfile://localhost/filesystemname/
+function resolveCdvFile (success, fail, request, options, size) {
+    var components = /cdvfile:\/\/localhost\/([^\/]+)\/(.*)/.exec(request); // eslint-disable-line no-useless-escape
+    var fsType = components[1];
+    var path = components[2];
     if (fsType === 'persistent') {
         resolve(success, fail, path, window.PERSISTENT, SANDBOXED, options, size);
-    }
-    else if (fsType === 'temporary') {
+    } else if (fsType === 'temporary') {
         resolve(success, fail, path, window.TEMPORARY, SANDBOXED, options, size);
-    }
-    else if (fsType === 'root') {
+    } else if (fsType === 'root') {
         resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
-    }
-    else {
-        fail(FileError.NOT_FOUND_ERR);
+    } else {
+        fail(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
     }
 }
 
-//resolve local:///
-function resolveLocal(success, fail, request, options) {
-    var path = localPath + request.substring(8);
+// resolve local:///
+function resolveLocal (success, fail, request, options) {
+    var path = localPath + request.substring(8); // eslint-disable-line no-undef
     resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
 }
 
-//validate parameters and set sandbox
-function resolve(success, fail, path, fsType, sandbox, options, size) {
+// validate parameters and set sandbox
+function resolve (success, fail, path, fsType, sandbox, options, size) {
     options = options || { create: false };
     size = size || info.MAX_SIZE;
     if (size > info.MAX_SIZE) {
-        //bb10 does not respect quota; fail at unreasonably large size
-        fail(FileError.QUOTA_EXCEEDED_ERR);
+        // bb10 does not respect quota; fail at unreasonably large size
+        fail(FileError.QUOTA_EXCEEDED_ERR); // eslint-disable-line no-undef
     } else if (path.indexOf(':') > -1) {
-        //files with : character are not valid in Cordova apps 
-        fail(FileError.ENCODING_ERR);
+        // files with : character are not valid in Cordova apps
+        fail(FileError.ENCODING_ERR); // eslint-disable-line no-undef
     } else {
         requestAnimationFrame(function () {
-            cordova.exec(function () {
+            cordova.exec(function () { // eslint-disable-line no-undef
                 requestAnimationFrame(function () {
                     resolveNative(success, fail, path, fsType, options, size);
                 });
@@ -128,17 +125,17 @@ function resolve(success, fail, path, fsType, sandbox, options, size) {
     }
 }
 
-//find path using webkit file system
-function resolveNative(success, fail, path, fsType, options, size) {
+// find path using webkit file system
+function resolveNative (success, fail, path, fsType, options, size) {
     window.webkitRequestFileSystem(
         fsType,
         size,
         function (fs) {
             if (path === '') {
-                //no path provided, call success with root file system
+                // no path provided, call success with root file system
                 success(createEntryFromNative(fs.root));
             } else {
-                //otherwise attempt to resolve as file
+                // otherwise attempt to resolve as file
                 fs.root.getFile(
                     path,
                     options,
@@ -146,7 +143,7 @@ function resolveNative(success, fail, path, fsType, options, size) {
                         success(createEntryFromNative(entry));
                     },
                     function (fileError) {
-                        //file not found, attempt to resolve as directory
+                        // file not found, attempt to resolve as directory
                         fs.root.getDirectory(
                             path,
                             options,
@@ -154,13 +151,13 @@ function resolveNative(success, fail, path, fsType, options, size) {
                                 success(createEntryFromNative(entry));
                             },
                             function (dirError) {
-                                //path cannot be resolved
-                                if (fileError.code === FileError.INVALID_MODIFICATION_ERR && 
+                                // path cannot be resolved
+                                if (fileError.code === FileError.INVALID_MODIFICATION_ERR && // eslint-disable-line no-undef
                                     options.exclusive) {
-                                    //mobile-spec expects this error code
-                                    fail(FileError.PATH_EXISTS_ERR);
+                                    // mobile-spec expects this error code
+                                    fail(FileError.PATH_EXISTS_ERR); // eslint-disable-line no-undef
                                 } else {
-                                    fail(FileError.NOT_FOUND_ERR);
+                                    fail(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                                 }
                             }
                         );

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/setMetadata.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/setMetadata.js b/www/blackberry10/setMetadata.js
index 0f2dc79..bff5312 100644
--- a/www/blackberry10/setMetadata.js
+++ b/www/blackberry10/setMetadata.js
@@ -19,15 +19,15 @@
  *
 */
 
-/* 
+/*
  * setMetadata
- * 
- * BB10 OS does not support setting file metadata via HTML5 File System 
+ *
+ * BB10 OS does not support setting file metadata via HTML5 File System
  */
 
 module.exports = function (success, fail, args) {
-    console.error("setMetadata not supported on BB10", arguments);
-    if (typeof(fail) === 'function') {
+    console.error('setMetadata not supported on BB10', arguments);
+    if (typeof (fail) === 'function') {
         fail();
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/truncate.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/truncate.js b/www/blackberry10/truncate.js
index fe43b7e..3d785b4 100644
--- a/www/blackberry10/truncate.js
+++ b/www/blackberry10/truncate.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * truncate
- * 
+ *
  * IN:
  *  args
  *   0 - URL of file to truncate
@@ -31,33 +31,37 @@
  *  fail - FileError
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        length = args[1],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data.loaded);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var length = args[1];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data.loaded);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             fs.nativeEntry.file(function (file) {
+                /* eslint-disable no-undef */
                 var reader = new FileReader()._realReader;
                 reader.onloadend = function () {
-                    var contents = new Uint8Array(this.result).subarray(0, length),
-                        blob = new Blob([contents]);
+                    var contents = new Uint8Array(this.result).subarray(0, length);
+                    var blob = new Blob([contents]);
+                        /* eslint-enable no-undef */
                     window.requestAnimationFrame(function () {
                         fs.nativeEntry.createWriter(function (fileWriter) {
                             fileWriter.onwriteend = onSuccess;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/write.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/write.js b/www/blackberry10/write.js
index b2ed261..62bd41b 100644
--- a/www/blackberry10/write.js
+++ b/www/blackberry10/write.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * write
- * 
+ *
  * IN:
  *  args
  *   0 - URL of file to write
@@ -32,35 +32,36 @@
  *  success - bytes written
  *  fail - FileError
  */
-
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        data = args[1],
-        offset = args[2],
-        //isBinary = args[3],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data.loaded);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else if (error && error.target && error.target.code) {
-                    fail(error.target.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var data = args[1];
+    var offset = args[2];
+    // isBinary = args[3],
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data.loaded);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else if (error && error.target && error.target.code) {
+                fail(error.target.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             fs.nativeEntry.createWriter(function (writer) {
-                var blob = new Blob([data]);
+                var blob = new Blob([data]); // eslint-disable-line no-undef
                 if (offset) {
                     writer.seek(offset);
                 }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/browser/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/browser/FileSystem.js b/www/browser/FileSystem.js
index c0996cb..a7c1d6c 100644
--- a/www/browser/FileSystem.js
+++ b/www/browser/FileSystem.js
@@ -19,13 +19,12 @@
  *
 */
 
-/*global FILESYSTEM_PREFIX: true, module*/
+/* global FILESYSTEM_PREFIX: true, module */
 
-FILESYSTEM_PREFIX = "file:///";
+FILESYSTEM_PREFIX = 'file:///';
 
 module.exports = {
-    __format__: function(fullPath) {
-        return (FILESYSTEM_PREFIX + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath));
+    __format__: function (fullPath) {
+        return (FILESYSTEM_PREFIX + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)); // eslint-disable-line no-undef
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/browser/Preparing.js
----------------------------------------------------------------------
diff --git a/www/browser/Preparing.js b/www/browser/Preparing.js
index 7845f9e..b826a65 100644
--- a/www/browser/Preparing.js
+++ b/www/browser/Preparing.js
@@ -20,9 +20,9 @@
 */
 
 (function () {
-    /*global require*/
+    /* global require */
 
-    //Only Chrome uses this file.
+    // Only Chrome uses this file.
     if (!require('./isChrome')()) {
         return;
     }
@@ -30,26 +30,26 @@
     var channel = require('cordova/channel');
     var FileError = require('./FileError');
     var PERSISTENT_FS_QUOTA = 5 * 1024 * 1024;
-    var filePluginIsReadyEvent = new Event('filePluginIsReady');
+    var filePluginIsReadyEvent = new Event('filePluginIsReady'); // eslint-disable-line no-undef
 
     var entryFunctionsCreated = false;
     var quotaWasRequested = false;
     var eventWasThrown = false;
 
     if (!window.requestFileSystem) {
-        window.requestFileSystem = function(type, size, win, fail) {
+        window.requestFileSystem = function (type, size, win, fail) {
             if (fail) {
-                fail("Not supported");
+                fail('Not supported');
             }
         };
     } else {
-        window.requestFileSystem(window.TEMPORARY, 1, createFileEntryFunctions, function() {});
+        window.requestFileSystem(window.TEMPORARY, 1, createFileEntryFunctions, function () {});
     }
 
     if (!window.resolveLocalFileSystemURL) {
-        window.resolveLocalFileSystemURL = function(url, win, fail) {
-            if(fail) {
-                fail("Not supported");
+        window.resolveLocalFileSystemURL = function (url, win, fail) {
+            if (fail) {
+                fail('Not supported');
             }
         };
     }
@@ -58,14 +58,14 @@
     // Cordova-specific (cdvfile://) universal way.
     // Aligns with specification: http://www.w3.org/TR/2011/WD-file-system-api-20110419/#widl-LocalFileSystem-resolveLocalFileSystemURL
     var nativeResolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
-    window.resolveLocalFileSystemURL = function(url, win, fail) {
+    window.resolveLocalFileSystemURL = function (url, win, fail) {
         /* If url starts with `cdvfile` then we need convert it to Chrome real url first:
           cdvfile://localhost/persistent/path/to/file -> filesystem:file://persistent/path/to/file */
-        if (url.trim().substr(0,7) === "cdvfile") {
+        if (url.trim().substr(0, 7) === 'cdvfile') {
             /* Quirk:
             Plugin supports cdvfile://localhost (local resources) only.
             I.e. external resources are not supported via cdvfile. */
-            if (url.indexOf("cdvfile://localhost") !== -1) {
+            if (url.indexOf('cdvfile://localhost') !== -1) {
                 // Browser supports temporary and persistent only
                 var indexPersistent = url.indexOf('persistent');
                 var indexTemporary = url.indexOf('temporary');
@@ -75,15 +75,15 @@
                    For example, filesystem:file:///persistent/somefile.txt,
                    filesystem:http://localhost:8080/persistent/somefile.txt. */
                 var prefix = 'filesystem:file:///';
-                if (location.protocol !== 'file:') {
-                    prefix = 'filesystem:' + location.origin + '/';
+                if (location.protocol !== 'file:') { // eslint-disable-line no-undef
+                    prefix = 'filesystem:' + location.origin + '/'; // eslint-disable-line no-undef
                 }
 
                 var result;
                 if (indexPersistent !== -1) {
                     // cdvfile://localhost/persistent/path/to/file -> filesystem:file://persistent/path/to/file
                     // or filesystem:http://localhost:8080/persistent/path/to/file
-                    result =  prefix + 'persistent' + url.substr(indexPersistent + 10);
+                    result = prefix + 'persistent' + url.substr(indexPersistent + 10);
                     nativeResolveLocalFileSystemURL(result, win, fail);
                     return;
                 }
@@ -106,8 +106,8 @@
         }
     };
 
-    function createFileEntryFunctions(fs) {
-        fs.root.getFile('todelete_658674_833_4_cdv', {create: true}, function(fileEntry) {
+    function createFileEntryFunctions (fs) {
+        fs.root.getFile('todelete_658674_833_4_cdv', {create: true}, function (fileEntry) {
             var fileEntryType = Object.getPrototypeOf(fileEntry);
             var entryType = Object.getPrototypeOf(fileEntryType);
 
@@ -126,59 +126,59 @@
                 return this.toURL();
             };
 
-            entryType.toInternalURL = function() {
-                if (this.toURL().indexOf("persistent") > -1) {
-                    return "cdvfile://localhost/persistent" + this.fullPath;
+            entryType.toInternalURL = function () {
+                if (this.toURL().indexOf('persistent') > -1) {
+                    return 'cdvfile://localhost/persistent' + this.fullPath;
                 }
 
-                if (this.toURL().indexOf("temporary") > -1) {
-                    return "cdvfile://localhost/temporary" + this.fullPath;
+                if (this.toURL().indexOf('temporary') > -1) {
+                    return 'cdvfile://localhost/temporary' + this.fullPath;
                 }
             };
 
-            entryType.setMetadata = function(win, fail /*, metadata*/) {
+            entryType.setMetadata = function (win, fail /*, metadata */) {
                 if (fail) {
-                    fail("Not supported");
+                    fail('Not supported');
                 }
             };
 
-            fileEntry.createWriter(function(writer) {
+            fileEntry.createWriter(function (writer) {
                 var originalWrite = writer.write;
                 var writerProto = Object.getPrototypeOf(writer);
-                writerProto.write = function(blob) {
-                    if(blob instanceof Blob) {
+                writerProto.write = function (blob) {
+                    if (blob instanceof Blob) { // eslint-disable-line no-undef
                         originalWrite.apply(this, [blob]);
                     } else {
-                        var realBlob = new Blob([blob]);
+                        var realBlob = new Blob([blob]); // eslint-disable-line no-undef
                         originalWrite.apply(this, [realBlob]);
-                   }
+                    }
                 };
 
-                fileEntry.remove(function(){ entryFunctionsCreated = true; }, function(){ /* empty callback */ });
-          });
+                fileEntry.remove(function () { entryFunctionsCreated = true; }, function () { /* empty callback */ });
+            });
         });
     }
 
-    window.initPersistentFileSystem = function(size, win, fail) {
+    window.initPersistentFileSystem = function (size, win, fail) {
         if (navigator.webkitPersistentStorage) {
             navigator.webkitPersistentStorage.requestQuota(size, win, fail);
             return;
         }
 
-        fail("This browser does not support this function");
+        fail('This browser does not support this function');
     };
 
     window.isFilePluginReadyRaised = function () { return eventWasThrown; };
 
-    window.initPersistentFileSystem(PERSISTENT_FS_QUOTA, function() {
+    window.initPersistentFileSystem(PERSISTENT_FS_QUOTA, function () {
         console.log('Persistent fs quota granted');
         quotaWasRequested = true;
-    }, function(e){
+    }, function (e) {
         console.log('Error occured while trying to request Persistent fs quota: ' + JSON.stringify(e));
     });
 
     channel.onCordovaReady.subscribe(function () {
-        function dispatchEventIfReady() {
+        function dispatchEventIfReady () {
             if (entryFunctionsCreated && quotaWasRequested) {
                 window.dispatchEvent(filePluginIsReadyEvent);
                 eventWasThrown = true;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/fileSystemPaths.js
----------------------------------------------------------------------
diff --git a/www/fileSystemPaths.js b/www/fileSystemPaths.js
index 640b9d6..f79794b 100644
--- a/www/fileSystemPaths.js
+++ b/www/fileSystemPaths.js
@@ -51,8 +51,8 @@ exports.file = {
 };
 
 channel.waitForInitialization('onFileSystemPathsReady');
-channel.onCordovaReady.subscribe(function() {
-    function after(paths) {
+channel.onCordovaReady.subscribe(function () {
+    function after (paths) {
         for (var k in paths) {
             exports.file[k] = paths[k];
         }
@@ -60,4 +60,3 @@ channel.onCordovaReady.subscribe(function() {
     }
     exec(after, null, 'File', 'requestAllPaths', []);
 });
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/fileSystems-roots.js
----------------------------------------------------------------------
diff --git a/www/fileSystems-roots.js b/www/fileSystems-roots.js
index 107a9b8..9a3fc7a 100644
--- a/www/fileSystems-roots.js
+++ b/www/fileSystems-roots.js
@@ -25,8 +25,8 @@ var FileSystem = require('./FileSystem');
 var exec = require('cordova/exec');
 
 // Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-require('./fileSystems').getFs = function(name, callback) {
-    function success(response) {
+require('./fileSystems').getFs = function (name, callback) {
+    function success (response) {
         fsMap = {};
         for (var i = 0; i < response.length; ++i) {
             var fsRoot = response[i];
@@ -39,7 +39,6 @@ require('./fileSystems').getFs = function(name, callback) {
     if (fsMap) {
         callback(fsMap[name]);
     } else {
-        exec(success, null, "File", "requestAllFileSystems", []);
+        exec(success, null, 'File', 'requestAllFileSystems', []);
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/fileSystems.js
----------------------------------------------------------------------
diff --git a/www/fileSystems.js b/www/fileSystems.js
index 8ecdec3..40e5574 100644
--- a/www/fileSystems.js
+++ b/www/fileSystems.js
@@ -20,6 +20,6 @@
 */
 
 // Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
-module.exports.getFs = function(name, callback) {
+module.exports.getFs = function (name, callback) {
     callback(null);
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/firefoxos/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/firefoxos/FileSystem.js b/www/firefoxos/FileSystem.js
index edc003b..4a84eb1 100644
--- a/www/firefoxos/FileSystem.js
+++ b/www/firefoxos/FileSystem.js
@@ -18,12 +18,11 @@
  * under the License.
  *
 */
-
-FILESYSTEM_PREFIX = "file:///";
+/* eslint no-undef : 0 */
+FILESYSTEM_PREFIX = 'file:///';
 
 module.exports = {
-    __format__: function(fullPath) {
+    __format__: function (fullPath) {
         return (FILESYSTEM_PREFIX + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath));
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/ios/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/ios/FileSystem.js b/www/ios/FileSystem.js
index 114ebb0..cb14c78 100644
--- a/www/ios/FileSystem.js
+++ b/www/ios/FileSystem.js
@@ -18,13 +18,12 @@
  * under the License.
  *
 */
-
-FILESYSTEM_PROTOCOL = "cdvfile";
+/* eslint no-undef : 0 */
+FILESYSTEM_PROTOCOL = 'cdvfile';
 
 module.exports = {
-    __format__: function(fullPath) {
-        var path = ('/'+this.name+(fullPath[0]==='/'?'':'/')+FileSystem.encodeURIPath(fullPath)).replace('//','/');
+    __format__: function (fullPath) {
+        var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
         return FILESYSTEM_PROTOCOL + '://localhost' + path;
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/osx/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/osx/FileSystem.js b/www/osx/FileSystem.js
index 114ebb0..cb14c78 100644
--- a/www/osx/FileSystem.js
+++ b/www/osx/FileSystem.js
@@ -18,13 +18,12 @@
  * under the License.
  *
 */
-
-FILESYSTEM_PROTOCOL = "cdvfile";
+/* eslint no-undef : 0 */
+FILESYSTEM_PROTOCOL = 'cdvfile';
 
 module.exports = {
-    __format__: function(fullPath) {
-        var path = ('/'+this.name+(fullPath[0]==='/'?'':'/')+FileSystem.encodeURIPath(fullPath)).replace('//','/');
+    __format__: function (fullPath) {
+        var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
         return FILESYSTEM_PROTOCOL + '://localhost' + path;
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/requestFileSystem.js
----------------------------------------------------------------------
diff --git a/www/requestFileSystem.js b/www/requestFileSystem.js
index 300937e..d9110cd 100644
--- a/www/requestFileSystem.js
+++ b/www/requestFileSystem.js
@@ -19,10 +19,10 @@
  *
 */
 
-(function() {
-    //For browser platform: not all browsers use this file.
-    function checkBrowser() {
-        if (cordova.platformId === "browser" && require('./isChrome')()) {
+(function () {
+    // For browser platform: not all browsers use this file.
+    function checkBrowser () {
+        if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
             module.exports = window.requestFileSystem || window.webkitRequestFileSystem;
             return true;
         }
@@ -32,10 +32,10 @@
         return;
     }
 
-    var argscheck = require('cordova/argscheck'),
-        FileError = require('./FileError'),
-        FileSystem = require('./FileSystem'),
-        exec = require('cordova/exec');
+    var argscheck = require('cordova/argscheck');
+    var FileError = require('./FileError');
+    var FileSystem = require('./FileSystem');
+    var exec = require('cordova/exec');
     var fileSystems = require('./fileSystems');
 
     /**
@@ -45,9 +45,9 @@
      * @param successCallback  invoked with a FileSystem object
      * @param errorCallback  invoked if error occurs retrieving file system
      */
-    var requestFileSystem = function(type, size, successCallback, errorCallback) {
+    var requestFileSystem = function (type, size, successCallback, errorCallback) {
         argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
-        var fail = function(code) {
+        var fail = function (code) {
             if (errorCallback) {
                 errorCallback(new FileError(code));
             }
@@ -57,10 +57,10 @@
             fail(FileError.SYNTAX_ERR);
         } else {
             // if successful, return a FileSystem object
-            var success = function(file_system) {
+            var success = function (file_system) {
                 if (file_system) {
                     if (successCallback) {
-                        fileSystems.getFs(file_system.name, function(fs) {
+                        fileSystems.getFs(file_system.name, function (fs) {
                             // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
                             if (!fs) {
                                 fs = new FileSystem(file_system.name, file_system.root);
@@ -68,13 +68,12 @@
                             successCallback(fs);
                         });
                     }
-                }
-                else {
+                } else {
                     // no FileSystem object returned
                     fail(FileError.NOT_FOUND_ERR);
                 }
             };
-            exec(success, fail, "File", "requestFileSystem", [type, size]);
+            exec(success, fail, 'File', 'requestFileSystem', [type, size]);
         }
     };
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/www/resolveLocalFileSystemURI.js b/www/resolveLocalFileSystemURI.js
index bfa3b07..764662c 100644
--- a/www/resolveLocalFileSystemURI.js
+++ b/www/resolveLocalFileSystemURI.js
@@ -18,10 +18,10 @@
  * under the License.
  *
 */
-(function() {
-    //For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`.
-    function checkBrowser() {
-        if (cordova.platformId === "browser" && require('./isChrome')()) {
+(function () {
+    // For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`.
+    function checkBrowser () {
+        if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
             module.exports.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
             return true;
         }
@@ -31,11 +31,11 @@
         return;
     }
 
-    var argscheck = require('cordova/argscheck'),
-        DirectoryEntry = require('./DirectoryEntry'),
-        FileEntry = require('./FileEntry'),
-        FileError = require('./FileError'),
-        exec = require('cordova/exec');
+    var argscheck = require('cordova/argscheck');
+    var DirectoryEntry = require('./DirectoryEntry');
+    var FileEntry = require('./FileEntry');
+    var FileError = require('./FileError');
+    var exec = require('cordova/exec');
     var fileSystems = require('./fileSystems');
 
     /**
@@ -44,49 +44,48 @@
      * @param successCallback  invoked with Entry object corresponding to URI
      * @param errorCallback    invoked if error occurs retrieving file system entry
      */
-    module.exports.resolveLocalFileSystemURL = module.exports.resolveLocalFileSystemURL || function(uri, successCallback, errorCallback) {
+    module.exports.resolveLocalFileSystemURL = module.exports.resolveLocalFileSystemURL || function (uri, successCallback, errorCallback) {
         argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments);
         // error callback
-        var fail = function(error) {
+        var fail = function (error) {
             if (errorCallback) {
                 errorCallback(new FileError(error));
             }
         };
         // sanity check for 'not:valid:filename' or '/not:valid:filename'
         // file.spec.12 window.resolveLocalFileSystemURI should error (ENCODING_ERR) when resolving invalid URI with leading /.
-        if(!uri || uri.split(":").length > 2) {
-            setTimeout( function() {
+        if (!uri || uri.split(':').length > 2) {
+            setTimeout(function () {
                 fail(FileError.ENCODING_ERR);
-            },0);
+            }, 0);
             return;
         }
         // if successful, return either a file or directory entry
-        var success = function(entry) {
+        var success = function (entry) {
             if (entry) {
                 if (successCallback) {
                     // create appropriate Entry object
-                    var fsName = entry.filesystemName || (entry.filesystem && entry.filesystem.name) || (entry.filesystem == window.PERSISTENT ? 'persistent' : 'temporary');
-                    fileSystems.getFs(fsName, function(fs) {
+                    var fsName = entry.filesystemName || (entry.filesystem && entry.filesystem.name) || (entry.filesystem === window.PERSISTENT ? 'persistent' : 'temporary'); // eslint-disable-line no-undef
+                    fileSystems.getFs(fsName, function (fs) {
                         // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
                         if (!fs) {
-                            fs = new FileSystem(fsName, {name:"", fullPath:"/"});
+                            fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
                         }
                         var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
                         successCallback(result);
                     });
                 }
-            }
-            else {
+            } else {
                 // no Entry object returned
                 fail(FileError.NOT_FOUND_ERR);
             }
         };
 
-        exec(success, fail, "File", "resolveLocalFileSystemURI", [uri]);
+        exec(success, fail, 'File', 'resolveLocalFileSystemURI', [uri]);
     };
 
-    module.exports.resolveLocalFileSystemURI = function() {
-        console.log("resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.");
+    module.exports.resolveLocalFileSystemURI = function () {
+        console.log('resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.');
         module.exports.resolveLocalFileSystemURL.apply(this, arguments);
     };
 })();

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/ubuntu/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/ubuntu/FileSystem.js b/www/ubuntu/FileSystem.js
index 3594565..20a1d11 100644
--- a/www/ubuntu/FileSystem.js
+++ b/www/ubuntu/FileSystem.js
@@ -19,16 +19,15 @@
  *
 */
 
-FILESYSTEM_PROTOCOL = "cdvfile";
+FILESYSTEM_PROTOCOL = 'cdvfile'; // eslint-disable-line no-undef
 
 module.exports = {
-    __format__: function(fullPath) {
+    __format__: function (fullPath) {
         if (this.name === 'content') {
             return 'content:/' + fullPath;
         }
-        var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//','/');
+        var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/'); // eslint-disable-line no-undef
 
-        return FILESYSTEM_PROTOCOL + '://localhost' + path;
+        return FILESYSTEM_PROTOCOL + '://localhost' + path; // eslint-disable-line no-undef
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/ubuntu/FileWriter.js
----------------------------------------------------------------------
diff --git a/www/ubuntu/FileWriter.js b/www/ubuntu/FileWriter.js
index 5428cb2..ef70c47 100644
--- a/www/ubuntu/FileWriter.js
+++ b/www/ubuntu/FileWriter.js
@@ -19,19 +19,20 @@
  *
 */
 
-var exec = require('cordova/exec'),
-    FileError = require('./FileError'),
-    ProgressEvent = require('./ProgressEvent');
+var exec = require('cordova/exec');
+var FileError = require('./FileError');
+var ProgressEvent = require('./ProgressEvent');
 
-function write(data) {
-    var that=this;
+function write (data) {
+    var that = this;
     var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
     var isBinary;
 
     // Check to see if the incoming data is a blob
+    /* eslint-disable no-undef */
     if (data instanceof File || (supportsBinary && data instanceof Blob)) {
         var fileReader = new FileReader();
-        fileReader.onload = function() {
+        fileReader.onload = function () {
             // Call this method again, with the arraybuffer as argument
             FileWriter.prototype.write.call(that, this.result);
         };
@@ -53,34 +54,34 @@ function write(data) {
 
     // WRITING state
     this.readyState = FileWriter.WRITING;
-
+    /* eslint-enable no-undef */
     var me = this;
 
     // If onwritestart callback
-    if (typeof me.onwritestart === "function") {
-        me.onwritestart(new ProgressEvent("writestart", {"target":me}));
+    if (typeof me.onwritestart === 'function') {
+        me.onwritestart(new ProgressEvent('writestart', {'target': me}));
     }
 
     if (data instanceof ArrayBuffer || data.buffer instanceof ArrayBuffer) {
         data = new Uint8Array(data);
-    var binary = "";
-    for (var i = 0; i < data.byteLength; i++) {
+        var binary = '';
+        for (var i = 0; i < data.byteLength; i++) {
             binary += String.fromCharCode(data[i]);
-    }
+        }
         data = binary;
     }
 
-    var prefix = "file://localhost";
+    var prefix = 'file://localhost';
     var path = this.localURL;
-    if (path.substr(0, prefix.length) == prefix) {
+    if (path.substr(0, prefix.length) === prefix) {
         path = path.substr(prefix.length);
     }
     // Write file
     exec(
         // Success callback
-        function(r) {
+        function (r) {
             // If DONE (cancelled), then don't do anything
-            if (me.readyState === FileWriter.DONE) {
+            if (me.readyState === FileWriter.DONE) { // eslint-disable-line no-undef
                 return;
             }
 
@@ -91,45 +92,45 @@ function write(data) {
             me.length = me.position;
 
             // DONE state
-            me.readyState = FileWriter.DONE;
+            me.readyState = FileWriter.DONE; // eslint-disable-line no-undef
 
             // If onwrite callback
-            if (typeof me.onwrite === "function") {
-                me.onwrite(new ProgressEvent("write", {"target":me}));
+            if (typeof me.onwrite === 'function') {
+                me.onwrite(new ProgressEvent('write', {'target': me}));
             }
 
             // If onwriteend callback
-            if (typeof me.onwriteend === "function") {
-                me.onwriteend(new ProgressEvent("writeend", {"target":me}));
+            if (typeof me.onwriteend === 'function') {
+                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
             }
         },
         // Error callback
-        function(e) {
+        function (e) {
             // If DONE (cancelled), then don't do anything
-            if (me.readyState === FileWriter.DONE) {
+            if (me.readyState === FileWriter.DONE) { // eslint-disable-line no-undef
                 return;
             }
 
             // DONE state
-            me.readyState = FileWriter.DONE;
+            me.readyState = FileWriter.DONE; // eslint-disable-line no-undef
 
             // Save error
             me.error = new FileError(e);
 
             // If onerror callback
-            if (typeof me.onerror === "function") {
-                me.onerror(new ProgressEvent("error", {"target":me}));
+            if (typeof me.onerror === 'function') {
+                me.onerror(new ProgressEvent('error', {'target': me}));
             }
 
             // If onwriteend callback
-            if (typeof me.onwriteend === "function") {
-                me.onwriteend(new ProgressEvent("writeend", {"target":me}));
+            if (typeof me.onwriteend === 'function') {
+                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
             }
-        }, "File", "write", [path, data, this.position, isBinary]);
+        }, 'File', 'write', [path, data, this.position, isBinary]);
 }
 
 module.exports = {
     write: write
 };
 
-require("cordova/exec/proxy").add("FileWriter", module.exports);
+require('cordova/exec/proxy').add('FileWriter', module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/ubuntu/fileSystems-roots.js
----------------------------------------------------------------------
diff --git a/www/ubuntu/fileSystems-roots.js b/www/ubuntu/fileSystems-roots.js
index d2c6857..4bd6d6d 100644
--- a/www/ubuntu/fileSystems-roots.js
+++ b/www/ubuntu/fileSystems-roots.js
@@ -24,8 +24,8 @@ var FileSystem = require('./FileSystem');
 var LocalFileSystem = require('./LocalFileSystem');
 var exec = require('cordova/exec');
 
-var requestFileSystem = function(type, size, successCallback) {
-    var success = function(file_system) {
+var requestFileSystem = function (type, size, successCallback) {
+    var success = function (file_system) {
         if (file_system) {
             if (successCallback) {
                 var fs = new FileSystem(file_system.name, file_system.root);
@@ -33,15 +33,15 @@ var requestFileSystem = function(type, size, successCallback) {
             }
         }
     };
-    exec(success, null, "File", "requestFileSystem", [type, size]);
+    exec(success, null, 'File', 'requestFileSystem', [type, size]);
 };
 
-require('./fileSystems').getFs = function(name, callback) {
+require('./fileSystems').getFs = function (name, callback) {
     if (fsMap) {
         callback(fsMap[name]);
     } else {
-        requestFileSystem(LocalFileSystem.PERSISTENT, 1, function(fs) {
-            requestFileSystem(LocalFileSystem.TEMPORARY, 1, function(tmp) {
+        requestFileSystem(LocalFileSystem.PERSISTENT, 1, function (fs) {
+            requestFileSystem(LocalFileSystem.TEMPORARY, 1, function (tmp) {
                 fsMap = {};
                 fsMap[tmp.name] = tmp;
                 fsMap[fs.name] = fs;
@@ -50,4 +50,3 @@ require('./fileSystems').getFs = function(name, callback) {
         });
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/wp/FileUploadOptions.js
----------------------------------------------------------------------
diff --git a/www/wp/FileUploadOptions.js b/www/wp/FileUploadOptions.js
index 696573a..869e263 100644
--- a/www/wp/FileUploadOptions.js
+++ b/www/wp/FileUploadOptions.js
@@ -27,21 +27,20 @@
  * @param mimeType {String}  Mimetype of the uploaded file. Defaults to image/jpeg.
  * @param params {Object}    Object with key: value params to send to the server.
  */
-var FileUploadOptions = function(fileKey, fileName, mimeType, params, headers, httpMethod) {
+var FileUploadOptions = function (fileKey, fileName, mimeType, params, headers, httpMethod) {
     this.fileKey = fileKey || null;
     this.fileName = fileName || null;
     this.mimeType = mimeType || null;
     this.headers = headers || null;
     this.httpMethod = httpMethod || null;
 
-    if(params && typeof params != typeof "") {
+    if (params && typeof params !== typeof '') {
         var arrParams = [];
-        for(var v in params) {
-            arrParams.push(v + "=" + params[v]);
+        for (var v in params) {
+            arrParams.push(v + '=' + params[v]);
         }
-        this.params = encodeURIComponent(arrParams.join("&"));
-    }
-    else {
+        this.params = encodeURIComponent(arrParams.join('&'));
+    } else {
         this.params = params || null;
     }
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/5] cordova-plugin-file git commit: CB-12895 : setup eslint and took out jshint

Posted by au...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 64ed7a9..a9ae20a 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -18,80 +18,81 @@
  *
  */
 
-/* jshint jasmine: true */
+/* eslint-env jasmine */
 /* global WebKitBlobBuilder */
 
 exports.defineAutoTests = function () {
-    var isBrowser = (cordova.platformId === "browser");
+    /* eslint-disable no-undef */
+    var isBrowser = (cordova.platformId === 'browser');
     // Use feature detection to determine current browser instead of checking user-agent
     var isChrome = isBrowser && window.webkitRequestFileSystem && window.webkitResolveLocalFileSystemURL;
     var isIE = isBrowser && (window.msIndexedDB);
     var isIndexedDBShim = isBrowser && !isChrome;   // Firefox and IE for example
 
-    var isWindows = (cordova.platformId === "windows" || cordova.platformId === "windows8");
-
+    var isWindows = (cordova.platformId === 'windows' || cordova.platformId === 'windows8');
+    /* eslint-enable no-undef */
     var MEDIUM_TIMEOUT = 15000;
 
     describe('File API', function () {
         // Adding a Jasmine helper matcher, to report errors when comparing to FileError better.
         var fileErrorMap = {
-            1 : 'NOT_FOUND_ERR',
-            2 : 'SECURITY_ERR',
-            3 : 'ABORT_ERR',
-            4 : 'NOT_READABLE_ERR',
-            5 : 'ENCODING_ERR',
-            6 : 'NO_MODIFICATION_ALLOWED_ERR',
-            7 : 'INVALID_STATE_ERR',
-            8 : 'SYNTAX_ERR',
-            9 : 'INVALID_MODIFICATION_ERR',
-            10 : 'QUOTA_EXCEEDED_ERR',
-            11 : 'TYPE_MISMATCH_ERR',
-            12 : 'PATH_EXISTS_ERR'
-        },
-        root,
-        temp_root,
-        persistent_root;
+            1: 'NOT_FOUND_ERR',
+            2: 'SECURITY_ERR',
+            3: 'ABORT_ERR',
+            4: 'NOT_READABLE_ERR',
+            5: 'ENCODING_ERR',
+            6: 'NO_MODIFICATION_ALLOWED_ERR',
+            7: 'INVALID_STATE_ERR',
+            8: 'SYNTAX_ERR',
+            9: 'INVALID_MODIFICATION_ERR',
+            10: 'QUOTA_EXCEEDED_ERR',
+            11: 'TYPE_MISMATCH_ERR',
+            12: 'PATH_EXISTS_ERR'
+        };
+        var root;
+        var temp_root;
+        var persistent_root;
         beforeEach(function (done) {
             // Custom Matchers
             jasmine.Expectation.addMatchers({
-                toBeFileError : function () {
+                toBeFileError: function () {
                     return {
-                        compare : function (error, code) {
+                        compare: function (error, code) {
                             var pass = error.code === code;
                             return {
-                                pass : pass,
-                                message : 'Expected FileError with code ' + fileErrorMap[error.code] + ' (' + error.code + ') to be ' + fileErrorMap[code] + '(' + code + ')'
+                                pass: pass,
+                                message: 'Expected FileError with code ' + fileErrorMap[error.code] + ' (' + error.code + ') to be ' + fileErrorMap[code] + '(' + code + ')'
                             };
                         }
                     };
                 },
-                toCanonicallyMatch : function () {
+                toCanonicallyMatch: function () {
                     return {
-                        compare : function (currentPath, path) {
-                            var a = path.split("/").join("").split("\\").join(""),
-                            b = currentPath.split("/").join("").split("\\").join(""),
-                            pass = a === b;
+                        compare: function (currentPath, path) {
+                            var a = path.split('/').join('').split('\\').join('');
+                            var b = currentPath.split('/').join('').split('\\').join('');
+                            var pass = a === b;
                             return {
-                                pass : pass,
-                                message : 'Expected paths to match : ' + path + ' should be ' + currentPath
+                                pass: pass,
+                                message: 'Expected paths to match : ' + path + ' should be ' + currentPath
                             };
                         }
                     };
                 },
-                toFailWithMessage : function () {
+                toFailWithMessage: function () {
                     return {
-                        compare : function (error, message) {
+                        compare: function (error, message) { // eslint-disable-line handle-callback-err
                             var pass = false;
                             return {
-                                pass : pass,
-                                message : message
+                                pass: pass,
+                                message: message
                             };
                         }
                     };
                 },
                 toBeDataUrl: function () {
                     return {
-                        compare : function (url) {
+                        compare: function (url) {
                             var pass = false;
                             // "data:application/octet-stream;base64,"
                             var header = url.substr(0, url.indexOf(','));
@@ -103,23 +104,23 @@ exports.defineAutoTests = function () {
                             }
                             var message = 'Expected ' + url + ' to be a valid data url. ' + header + ' is not valid header for data uris';
                             return {
-                                pass : pass,
-                                message : message
+                                pass: pass,
+                                message: message
                             };
                         }
                     };
                 }
             });
-            //Define global variables
+            // Define global variables
             var onError = function (e) {
                 console.log('[ERROR] Problem setting up root filesystem for test running! Error to follow.');
                 console.log(JSON.stringify(e));
             };
-            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
+            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) { // eslint-disable-line no-undef
                 root = fileSystem.root;
                 // set in file.tests.js
                 persistent_root = root;
-                window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function (fileSystem) {
+                window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function (fileSystem) { // eslint-disable-line no-undef
                     temp_root = fileSystem.root;
                     // set in file.tests.js
                     done();
@@ -131,7 +132,7 @@ exports.defineAutoTests = function () {
         var deleteEntry = function (name, success, error) {
             // deletes entry, if it exists
             // entry.remove success callback is required: http://www.w3.org/TR/2011/WD-file-system-api-20110419/#the-entry-interface
-            success = success || function() {};
+            success = success || function () {};
             error = error || failed.bind(null, success, 'deleteEntry failed.');
 
             window.resolveLocalFileSystemURL(root.toURL() + '/' + name, function (entry) {
@@ -145,21 +146,21 @@ exports.defineAutoTests = function () {
         // deletes file, if it exists, then invokes callback
         var deleteFile = function (fileName, callback) {
             // entry.remove success callback is required: http://www.w3.org/TR/2011/WD-file-system-api-20110419/#the-entry-interface
-            callback = callback || function() {};
+            callback = callback || function () {};
 
             root.getFile(fileName, null, // remove file system entry
                 function (entry) {
-                entry.remove(callback, function () {
-                    console.log('[ERROR] deleteFile cleanup method invoked fail callback.');
-                });
-            }, // doesn't exist
+                    entry.remove(callback, function () {
+                        console.log('[ERROR] deleteFile cleanup method invoked fail callback.');
+                    });
+                }, // doesn't exist
                 callback);
         };
         // deletes and re-creates the specified file
         var createFile = function (fileName, success, error) {
             deleteEntry(fileName, function () {
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, success, error);
             }, error);
         };
@@ -167,18 +168,18 @@ exports.defineAutoTests = function () {
         var createDirectory = function (dirName, success, error) {
             deleteEntry(dirName, function () {
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, success, error);
             }, error);
         };
-        function failed(done, msg, error) {
-            var info = typeof msg == 'undefined' ? 'Unexpected error callback' : msg;
+        function failed (done, msg, error) {
+            var info = typeof msg === 'undefined' ? 'Unexpected error callback' : msg;
             var codeMsg = (error && error.code) ? (': ' + fileErrorMap[error.code]) : '';
             expect(true).toFailWithMessage(info + '\n' + JSON.stringify(error) + codeMsg);
             done();
         }
         var succeed = function (done, msg) {
-            var info = typeof msg == 'undefined' ? 'Unexpected success callback' : msg;
+            var info = typeof msg === 'undefined' ? 'Unexpected success callback' : msg;
             expect(true).toFailWithMessage(info);
             done();
         };
@@ -192,7 +193,8 @@ exports.defineAutoTests = function () {
             return base + extension;
         };
         describe('FileError object', function () {
-            it("file.spec.1 should define FileError constants", function () {
+            /* eslint-disable no-undef */
+            it('file.spec.1 should define FileError constants', function () {
                 expect(FileError.NOT_FOUND_ERR).toBe(1);
                 expect(FileError.SECURITY_ERR).toBe(2);
                 expect(FileError.ABORT_ERR).toBe(3);
@@ -208,22 +210,23 @@ exports.defineAutoTests = function () {
             });
         });
         describe('LocalFileSystem', function () {
-            it("file.spec.2 should define LocalFileSystem constants", function () {
+            it('file.spec.2 should define LocalFileSystem constants', function () {
                 expect(LocalFileSystem.TEMPORARY).toBe(0);
                 expect(LocalFileSystem.PERSISTENT).toBe(1);
+                /* eslint-enable no-undef */
             });
             describe('window.requestFileSystem', function () {
-                it("file.spec.3 should be defined", function () {
+                it('file.spec.3 should be defined', function () {
                     expect(window.requestFileSystem).toBeDefined();
                 });
-                it("file.spec.4 should be able to retrieve a PERSISTENT file system", function (done) {
+                it('file.spec.4 should be able to retrieve a PERSISTENT file system', function (done) {
                     var win = function (fileSystem) {
                         expect(fileSystem).toBeDefined();
                         expect(fileSystem.name).toBeDefined();
                         if (isChrome) {
-                            expect(fileSystem.name).toContain("Persistent");
+                            expect(fileSystem.name).toContain('Persistent');
                         } else {
-                            expect(fileSystem.name).toBe("persistent");
+                            expect(fileSystem.name).toBe('persistent');
                         }
                         expect(fileSystem.root).toBeDefined();
                         expect(fileSystem.root.filesystem).toBeDefined();
@@ -238,54 +241,54 @@ exports.defineAutoTests = function () {
                     var spaceRequired = isBrowser ? 0 : 1024;
 
                     // retrieve PERSISTENT file system
-                    window.requestFileSystem(LocalFileSystem.PERSISTENT, spaceRequired, win, failed.bind(null, done, 'window.requestFileSystem - Error retrieving PERSISTENT file system'));
+                    window.requestFileSystem(LocalFileSystem.PERSISTENT, spaceRequired, win, failed.bind(null, done, 'window.requestFileSystem - Error retrieving PERSISTENT file system')); // eslint-disable-line no-undef
                 });
-                it("file.spec.5 should be able to retrieve a TEMPORARY file system", function (done) {
+                it('file.spec.5 should be able to retrieve a TEMPORARY file system', function (done) {
                     var win = function (fileSystem) {
                         expect(fileSystem).toBeDefined();
                         if (isChrome) {
-                            expect(fileSystem.name).toContain("Temporary");
+                            expect(fileSystem.name).toContain('Temporary');
                         } else {
-                            expect(fileSystem.name).toBe("temporary");
+                            expect(fileSystem.name).toBe('temporary');
                         }
                         expect(fileSystem.root).toBeDefined();
                         expect(fileSystem.root.filesystem).toBeDefined();
                         expect(fileSystem.root.filesystem).toBe(fileSystem);
                         done();
                     };
-                    //retrieve TEMPORARY file system
-                    window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, win, failed.bind(null, done, 'window.requestFileSystem - Error retrieving TEMPORARY file system'));
+                    // retrieve TEMPORARY file system
+                    window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, win, failed.bind(null, done, 'window.requestFileSystem - Error retrieving TEMPORARY file system')); // eslint-disable-line no-undef
                 });
-                it("file.spec.6 should error if you request a file system that is too large", function (done) {
+                it('file.spec.6 should error if you request a file system that is too large', function (done) {
                     if (isBrowser) {
-                        /*window.requestFileSystem TEMPORARY and PERSISTENT filesystem quota is not limited in Chrome.
+                        /* window.requestFileSystem TEMPORARY and PERSISTENT filesystem quota is not limited in Chrome.
                         Firefox filesystem size is not limited but every 50MB request user permission.
                         IE10 allows up to 10mb of combined AppCache and IndexedDB used in implementation
                         of filesystem without prompting, once you hit that level you will be asked if you
                         want to allow it to be increased up to a max of 250mb per site.
-                        So `size` parameter for `requestFileSystem` function does not affect on filesystem in Firefox and IE.*/
+                        So `size` parameter for `requestFileSystem` function does not affect on filesystem in Firefox and IE. */
                         pending();
                     }
 
                     var fail = function (error) {
                         expect(error).toBeDefined();
-                        expect(error).toBeFileError(FileError.QUOTA_EXCEEDED_ERR);
+                        expect(error).toBeFileError(FileError.QUOTA_EXCEEDED_ERR); // eslint-disable-line no-undef
                         done();
                     };
-                    //win = createWin('window.requestFileSystem');
+                    // win = createWin('window.requestFileSystem');
                     // Request the file system
-                    window.requestFileSystem(LocalFileSystem.TEMPORARY, 1000000000000000, failed.bind(null, done, 'window.requestFileSystem - Error retrieving TEMPORARY file system'), fail);
+                    window.requestFileSystem(LocalFileSystem.TEMPORARY, 1000000000000000, failed.bind(null, done, 'window.requestFileSystem - Error retrieving TEMPORARY file system'), fail); // eslint-disable-line no-undef
                 });
-                it("file.spec.7 should error out if you request a file system that does not exist", function (done) {
+                it('file.spec.7 should error out if you request a file system that does not exist', function (done) {
 
                     var fail = function (error) {
                         expect(error).toBeDefined();
                         if (isChrome) {
-                            /*INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of SYNTAX_ERR(code: 8)
-                            on requesting of a non-existant filesystem.*/
-                            //expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
+                            /* INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of SYNTAX_ERR(code: 8)
+                            on requesting of a non-existant filesystem. */
+                            // expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
                         } else {
-                            expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                            expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                         }
                         done();
                     };
@@ -294,10 +297,10 @@ exports.defineAutoTests = function () {
                 });
             });
             describe('window.resolveLocalFileSystemURL', function () {
-                it("file.spec.8 should be defined", function () {
+                it('file.spec.8 should be defined', function () {
                     expect(window.resolveLocalFileSystemURL).toBeDefined();
                 });
-                it("file.spec.9 should resolve a valid file name", function (done) {
+                it('file.spec.9 should resolve a valid file name', function (done) {
                     var fileName = 'file.spec.9';
                     var win = function (fileEntry) {
                         expect(fileEntry).toBeDefined();
@@ -313,7 +316,7 @@ exports.defineAutoTests = function () {
                         window.resolveLocalFileSystemURL(entry.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entry.toURL()));
                     }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName), failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
                 });
-                it("file.spec.9.1 should resolve a file even with a terminating slash", function (done) {
+                it('file.spec.9.1 should resolve a file even with a terminating slash', function (done) {
                     var fileName = 'file.spec.9.1';
                     var win = function (fileEntry) {
                         expect(fileEntry).toBeDefined();
@@ -330,7 +333,7 @@ exports.defineAutoTests = function () {
                         window.resolveLocalFileSystemURL(entryURL, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entryURL));
                     }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName), failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
                 });
-                it("file.spec.9.5 should resolve a directory", function (done) {
+                it('file.spec.9.5 should resolve a directory', function (done) {
                     var fileName = 'file.spec.9.5';
                     var win = function (fileEntry) {
                         expect(fileEntry).toBeDefined();
@@ -342,13 +345,13 @@ exports.defineAutoTests = function () {
                         // cleanup
                         deleteEntry(fileName, done);
                     };
-                    function gotDirectory(entry) {
+                    function gotDirectory (entry) {
                         // lookup file system entry
                         window.resolveLocalFileSystemURL(entry.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving directory URL: ' + entry.toURL()));
                     }
                     createDirectory(fileName, gotDirectory, failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName), failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName));
                 });
-                it("file.spec.9.6 should resolve a directory even without a terminating slash", function (done) {
+                it('file.spec.9.6 should resolve a directory even without a terminating slash', function (done) {
                     var fileName = 'file.spec.9.6';
                     var win = function (fileEntry) {
                         expect(fileEntry).toBeDefined();
@@ -360,7 +363,7 @@ exports.defineAutoTests = function () {
                         // cleanup
                         deleteEntry(fileName, done);
                     };
-                    function gotDirectory(entry) {
+                    function gotDirectory (entry) {
                         // lookup file system entry
                         var entryURL = entry.toURL();
                         entryURL = entryURL.substring(0, entryURL.length - 1);
@@ -369,12 +372,12 @@ exports.defineAutoTests = function () {
                     createDirectory(fileName, gotDirectory, failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName), failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName));
                 });
 
-                it("file.spec.9.7 should resolve a file with valid nativeURL", function (done) {
+                it('file.spec.9.7 should resolve a file with valid nativeURL', function (done) {
                     if (isBrowser) {
                         pending('browsers doesn\'t return nativeURL');
                     }
-                    var fileName = "de.create.file",
-                    win = function (entry) {
+                    var fileName = 'de.create.file';
+                    var win = function (entry) {
                         var path = entry.nativeURL.split('///')[1];
                         expect(/\/{2,}/.test(path)).toBeFalsy();
                         // cleanup
@@ -385,12 +388,12 @@ exports.defineAutoTests = function () {
                     }, win, succeed.bind(null, done, 'root.getFile - Error unexpected callback, file should not exists: ' + fileName));
                 });
 
-                it("file.spec.10 resolve valid file name with parameters", function (done) {
-                    var fileName = "resolve.file.uri.params",
-                    win = function (fileEntry) {
+                it('file.spec.10 resolve valid file name with parameters', function (done) {
+                    var fileName = 'resolve.file.uri.params';
+                    var win = function (fileEntry) {
                         expect(fileEntry).toBeDefined();
-                        if (fileEntry.toURL().toLowerCase().substring(0, 10) === "cdvfile://") {
-                            expect(fileEntry.fullPath).toBe("/" + fileName + "?1234567890");
+                        if (fileEntry.toURL().toLowerCase().substring(0, 10) === 'cdvfile://') {
+                            expect(fileEntry.fullPath).toBe('/' + fileName + '?1234567890');
                         }
                         expect(fileEntry.name).toBe(fileName);
                         // cleanup
@@ -398,31 +401,31 @@ exports.defineAutoTests = function () {
                     };
                     // create a new file entry
                     createFile(fileName, function (entry) {
-                        window.resolveLocalFileSystemURL(entry.toURL() + "?1234567890", win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + entry.toURL()));
+                        window.resolveLocalFileSystemURL(entry.toURL() + '?1234567890', win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + entry.toURL()));
                     }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
                 });
-                it("file.spec.11 should error (NOT_FOUND_ERR) when resolving (non-existent) invalid file name", function (done) {
-                    var fileName = cordova.platformId === 'windowsphone' ? root.toURL() + "/" + "this.is.not.a.valid.file.txt" : joinURL(root.toURL(), "this.is.not.a.valid.file.txt"),
-                        fail = function (error) {
+                it('file.spec.11 should error (NOT_FOUND_ERR) when resolving (non-existent) invalid file name', function (done) {
+                    var fileName = cordova.platformId === 'windowsphone' ? root.toURL() + '/' + 'this.is.not.a.valid.file.txt' : joinURL(root.toURL(), 'this.is.not.a.valid.file.txt'); // eslint-disable-line no-undef
+                    var fail = function (error) {
                         expect(error).toBeDefined();
                         if (isChrome) {
-                            expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                            expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                         } else {
-                            expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                            expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                         }
                         done();
                     };
                     // lookup file system entry
                     window.resolveLocalFileSystemURL(fileName, succeed.bind(null, done, 'window.resolveLocalFileSystemURL - Error unexpected callback resolving file URI: ' + fileName), fail);
                 });
-                it("file.spec.12 should error (ENCODING_ERR) when resolving invalid URI with leading /", function (done) {
-                    var fileName = "/this.is.not.a.valid.url",
-                        fail = function (error) {
+                it('file.spec.12 should error (ENCODING_ERR) when resolving invalid URI with leading /', function (done) {
+                    var fileName = '/this.is.not.a.valid.url';
+                    var fail = function (error) {
                         expect(error).toBeDefined();
                         if (isChrome) {
-                            // O.o chrome returns error code 0
+                        // O.o chrome returns error code 0
                         } else {
-                            expect(error).toBeFileError(FileError.ENCODING_ERR);
+                            expect(error).toBeFileError(FileError.ENCODING_ERR); // eslint-disable-line no-undef
                         }
                         done();
                     };
@@ -431,17 +434,17 @@ exports.defineAutoTests = function () {
                 });
             });
         });
-        //LocalFileSystem
+        // LocalFileSystem
         describe('Metadata interface', function () {
-            it("file.spec.13 should exist and have the right properties", function () {
-                var metadata = new Metadata();
+            it('file.spec.13 should exist and have the right properties', function () {
+                var metadata = new Metadata(); // eslint-disable-line no-undef
                 expect(metadata).toBeDefined();
                 expect(metadata.modificationTime).toBeDefined();
             });
         });
         describe('Flags interface', function () {
-            it("file.spec.14 should exist and have the right properties", function () {
-                var flags = new Flags(false, true);
+            it('file.spec.14 should exist and have the right properties', function () {
+                var flags = new Flags(false, true); // eslint-disable-line no-undef
                 expect(flags).toBeDefined();
                 expect(flags.create).toBeDefined();
                 expect(flags.create).toBe(false);
@@ -450,7 +453,7 @@ exports.defineAutoTests = function () {
             });
         });
         describe('FileSystem interface', function () {
-            it("file.spec.15 should have a root that is a DirectoryEntry", function (done) {
+            it('file.spec.15 should have a root that is a DirectoryEntry', function (done) {
                 var win = function (entry) {
                     expect(entry).toBeDefined();
                     expect(entry.isFile).toBe(false);
@@ -473,26 +476,26 @@ exports.defineAutoTests = function () {
             });
         });
         describe('DirectoryEntry', function () {
-            it("file.spec.16 getFile: get Entry for file that does not exist", function (done) {
-                var fileName = "de.no.file",
-                fail = function (error) {
+            it('file.spec.16 getFile: get Entry for file that does not exist', function (done) {
+                var fileName = 'de.no.file';
+                var fail = function (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                        expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                     } else {
-                        expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                        expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                     }
                     done();
                 };
                 // create:false, exclusive:false, file does not exist
                 root.getFile(fileName, {
-                    create : false
+                    create: false
                 }, succeed.bind(null, done, 'root.getFile - Error unexpected callback, file should not exists: ' + fileName), fail);
             });
-            it("file.spec.17 getFile: create new file", function (done) {
-                var fileName = "de.create.file",
-                filePath = joinURL(root.fullPath, fileName),
-                win = function (entry) {
+            it('file.spec.17 getFile: create new file', function (done) {
+                var fileName = 'de.create.file';
+                var filePath = joinURL(root.fullPath, fileName);
+                var win = function (entry) {
                     expect(entry).toBeDefined();
                     expect(entry.isFile).toBe(true);
                     expect(entry.isDirectory).toBe(false);
@@ -503,13 +506,13 @@ exports.defineAutoTests = function () {
                 };
                 // create:true, exclusive:false, file does not exist
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, win, succeed.bind(null, done, 'root.getFile - Error unexpected callback, file should not exists: ' + fileName));
             });
-            it("file.spec.18 getFile: create new file (exclusive)", function (done) {
-                var fileName = "de.create.exclusive.file",
-                filePath = joinURL(root.fullPath, fileName),
-                win = function (entry) {
+            it('file.spec.18 getFile: create new file (exclusive)', function (done) {
+                var fileName = 'de.create.exclusive.file';
+                var filePath = joinURL(root.fullPath, fileName);
+                var win = function (entry) {
                     expect(entry).toBeDefined();
                     expect(entry.isFile).toBe(true);
                     expect(entry.isDirectory).toBe(false);
@@ -520,15 +523,15 @@ exports.defineAutoTests = function () {
                 };
                 // create:true, exclusive:true, file does not exist
                 root.getFile(fileName, {
-                    create : true,
-                    exclusive : true
+                    create: true,
+                    exclusive: true
                 }, win, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName));
             });
-            it("file.spec.19 getFile: create file that already exists", function (done) {
-                var fileName = "de.create.existing.file",
-                filePath = joinURL(root.fullPath, fileName);
+            it('file.spec.19 getFile: create file that already exists', function (done) {
+                var fileName = 'de.create.existing.file';
+                var filePath = joinURL(root.fullPath, fileName);
 
-                function win(entry) {
+                function win (entry) {
                     expect(entry).toBeDefined();
                     expect(entry.isFile).toBe(true);
                     expect(entry.isDirectory).toBe(false);
@@ -538,53 +541,53 @@ exports.defineAutoTests = function () {
                     deleteEntry(entry.name, done);
                 }
 
-                function getFile(file) {
+                function getFile (file) {
                     // create:true, exclusive:false, file exists
                     root.getFile(fileName, {
-                        create : true
+                        create: true
                     }, win, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName));
                 }
 
                 // create file to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, getFile, failed.bind(null, done, 'root.getFile - Error on initial creating file: ' + fileName));
             });
-            it("file.spec.20 getFile: create file that already exists (exclusive)", function (done) {
-                var fileName = "de.create.exclusive.existing.file",
-                existingFile;
+            it('file.spec.20 getFile: create file that already exists (exclusive)', function (done) {
+                var fileName = 'de.create.exclusive.existing.file';
+                var existingFile;
 
-                function fail(error) {
+                function fail (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        /*INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of PATH_EXISTS_ERR(code: 12)
-                        on trying to exclusively create a file, which already exists in Chrome.*/
-                        //expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
+                        /* INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of PATH_EXISTS_ERR(code: 12)
+                        on trying to exclusively create a file, which already exists in Chrome. */
+                        // expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
                     } else {
-                        expect(error).toBeFileError(FileError.PATH_EXISTS_ERR);
+                        expect(error).toBeFileError(FileError.PATH_EXISTS_ERR); // eslint-disable-line no-undef
                     }
                     // cleanup
                     deleteEntry(existingFile.name, done);
                 }
 
-                function getFile(file) {
+                function getFile (file) {
                     existingFile = file;
                     // create:true, exclusive:true, file exists
                     root.getFile(fileName, {
-                        create : true,
-                        exclusive : true
+                        create: true,
+                        exclusive: true
                     }, succeed.bind(null, done, 'root.getFile - getFile function - Error unexpected callback, file should exists: ' + fileName), fail);
                 }
 
                 // create file to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, getFile, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName));
             });
-            it("file.spec.21 DirectoryEntry.getFile: get Entry for existing file", function (done) {
-                var fileName = "de.get.file",
-                filePath = joinURL(root.fullPath, fileName),
-                win = function (entry) {
+            it('file.spec.21 DirectoryEntry.getFile: get Entry for existing file', function (done) {
+                var fileName = 'de.get.file';
+                var filePath = joinURL(root.fullPath, fileName);
+                var win = function (entry) {
                     expect(entry).toBeDefined();
                     expect(entry.isFile).toBe(true);
                     expect(entry.isDirectory).toBe(false);
@@ -592,58 +595,58 @@ exports.defineAutoTests = function () {
                     expect(entry.fullPath).toCanonicallyMatch(filePath);
                     expect(entry.filesystem).toBeDefined();
                     expect(entry.filesystem).toBe(root.filesystem);
-                    //clean up
+                    // clean up
                     deleteEntry(entry.name, done);
-                },
-                getFile = function (file) {
+                };
+                var getFile = function (file) {
                     // create:false, exclusive:false, file exists
                     root.getFile(fileName, {
-                        create : false
+                        create: false
                     }, win, failed.bind(null, done, 'root.getFile - Error getting file entry: ' + fileName));
                 };
                 // create file to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, getFile, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName));
             });
-            it("file.spec.22 DirectoryEntry.getFile: get FileEntry for invalid path", function (done) {
+            it('file.spec.22 DirectoryEntry.getFile: get FileEntry for invalid path', function (done) {
                 if (isBrowser) {
-                    /*The plugin does not follow to ["8.3 Naming restrictions"]
-                    (http://www.w3.org/TR/2011/WD-file-system-api-20110419/#naming-restrictions).*/
+                    /* The plugin does not follow to ["8.3 Naming restrictions"]
+                    (http://www.w3.org/TR/2011/WD-file-system-api-20110419/#naming-restrictions). */
                     pending();
                 }
 
-                var fileName = "de:invalid:path",
-                fail = function (error) {
+                var fileName = 'de:invalid:path';
+                var fail = function (error) {
                     expect(error).toBeDefined();
-                    expect(error).toBeFileError(FileError.ENCODING_ERR);
+                    expect(error).toBeFileError(FileError.ENCODING_ERR); // eslint-disable-line no-undef
                     done();
                 };
                 // create:false, exclusive:false, invalid path
                 root.getFile(fileName, {
-                    create : false
+                    create: false
                 }, succeed.bind(null, done, 'root.getFile - Error unexpected callback, file should not exists: ' + fileName), fail);
             });
-            it("file.spec.23 DirectoryEntry.getDirectory: get Entry for directory that does not exist", function (done) {
-                var dirName = "de.no.dir",
-                fail = function (error) {
+            it('file.spec.23 DirectoryEntry.getDirectory: get Entry for directory that does not exist', function (done) {
+                var dirName = 'de.no.dir';
+                var fail = function (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                        expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                     } else {
-                        expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                        expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                     }
                     done();
                 };
                 // create:false, exclusive:false, directory does not exist
                 root.getDirectory(dirName, {
-                    create : false
+                    create: false
                 }, succeed.bind(null, done, 'root.getDirectory - Error unexpected callback, directory should not exists: ' + dirName), fail);
             });
-            it("file.spec.24 DirectoryEntry.getDirectory: create new dir with space then resolveLocalFileSystemURL", function (done) {
-                var dirName = "de create dir";
+            it('file.spec.24 DirectoryEntry.getDirectory: create new dir with space then resolveLocalFileSystemURL', function (done) {
+                var dirName = 'de create dir';
 
-                function win(directory) {
+                function win (directory) {
                     expect(directory).toBeDefined();
                     expect(directory.isFile).toBe(false);
                     expect(directory.isDirectory).toBe(true);
@@ -653,7 +656,7 @@ exports.defineAutoTests = function () {
                     deleteEntry(directory.name, done);
                 }
 
-                function getDir(dirEntry) {
+                function getDir (dirEntry) {
                     expect(dirEntry.filesystem).toBeDefined();
                     expect(dirEntry.filesystem).toBe(root.filesystem);
                     var dirURI = dirEntry.toURL();
@@ -663,7 +666,7 @@ exports.defineAutoTests = function () {
 
                 // create:true, exclusive:false, directory does not exist
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, getDir, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
             // This test is excluded, and should probably be removed. Filesystem
@@ -672,11 +675,11 @@ exports.defineAutoTests = function () {
             // handled by the implementation.
             // If a particular platform uses paths internally rather than URLs, // then that platform should careful to pass them correctly to its
             // backend.
-            xit("file.spec.25 DirectoryEntry.getDirectory: create new dir with space resolveLocalFileSystemURL with encoded URI", function (done) {
-                var dirName = "de create dir2",
-                dirPath = joinURL(root.fullPath, dirName);
+            xit('file.spec.25 DirectoryEntry.getDirectory: create new dir with space resolveLocalFileSystemURL with encoded URI', function (done) {
+                var dirName = 'de create dir2';
+                var dirPath = joinURL(root.fullPath, dirName);
 
-                function win(directory) {
+                function win (directory) {
                     expect(directory).toBeDefined();
                     expect(directory.isFile).toBe(false);
                     expect(directory.isDirectory).toBe(true);
@@ -686,7 +689,7 @@ exports.defineAutoTests = function () {
                     deleteEntry(directory.name, done);
                 }
 
-                function getDir(dirEntry) {
+                function getDir (dirEntry) {
                     var dirURI = dirEntry.toURL();
                     // now encode URI and try to resolve
                     window.resolveLocalFileSystemURL(encodeURI(dirURI), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - getDir function - Error resolving directory: ' + dirURI));
@@ -694,13 +697,13 @@ exports.defineAutoTests = function () {
 
                 // create:true, exclusive:false, directory does not exist
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, getDir, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.26 DirectoryEntry.getDirectory: create new directory", function (done) {
-                var dirName = "de.create.dir",
-                dirPath = joinURL(root.fullPath, dirName),
-                win = function (directory) {
+            it('file.spec.26 DirectoryEntry.getDirectory: create new directory', function (done) {
+                var dirName = 'de.create.dir';
+                var dirPath = joinURL(root.fullPath, dirName);
+                var win = function (directory) {
                     expect(directory).toBeDefined();
                     expect(directory.isFile).toBe(false);
                     expect(directory.isDirectory).toBe(true);
@@ -713,13 +716,13 @@ exports.defineAutoTests = function () {
                 };
                 // create:true, exclusive:false, directory does not exist
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, win, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.27 DirectoryEntry.getDirectory: create new directory (exclusive)", function (done) {
-                var dirName = "de.create.exclusive.dir",
-                dirPath = joinURL(root.fullPath, dirName),
-                win = function (directory) {
+            it('file.spec.27 DirectoryEntry.getDirectory: create new directory (exclusive)', function (done) {
+                var dirName = 'de.create.exclusive.dir';
+                var dirPath = joinURL(root.fullPath, dirName);
+                var win = function (directory) {
                     expect(directory).toBeDefined();
                     expect(directory.isFile).toBe(false);
                     expect(directory.isDirectory).toBe(true);
@@ -732,14 +735,14 @@ exports.defineAutoTests = function () {
                 };
                 // create:true, exclusive:true, directory does not exist
                 root.getDirectory(dirName, {
-                    create : true,
-                    exclusive : true
+                    create: true,
+                    exclusive: true
                 }, win, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.28 DirectoryEntry.getDirectory: create directory that already exists", function (done) {
-                var dirName = "de.create.existing.dir",
-                dirPath = joinURL(root.fullPath, dirName),
-                win = function (directory) {
+            it('file.spec.28 DirectoryEntry.getDirectory: create directory that already exists', function (done) {
+                var dirName = 'de.create.existing.dir';
+                var dirPath = joinURL(root.fullPath, dirName);
+                var win = function (directory) {
                     expect(directory).toBeDefined();
                     expect(directory.isFile).toBe(false);
                     expect(directory.isDirectory).toBe(true);
@@ -750,45 +753,45 @@ exports.defineAutoTests = function () {
                 };
                 // create directory to kick off it
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, function () {
                     root.getDirectory(dirName, {
-                        create : true
+                        create: true
                     }, win, failed.bind(null, done, 'root.getDirectory - Error creating existent second directory : ' + dirName));
                 }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.29 DirectoryEntry.getDirectory: create directory that already exists (exclusive)", function (done) {
+            it('file.spec.29 DirectoryEntry.getDirectory: create directory that already exists (exclusive)', function (done) {
 
-                var dirName = "de.create.exclusive.existing.dir",
-                existingDir,
-                fail = function (error) {
+                var dirName = 'de.create.exclusive.existing.dir';
+                var existingDir;
+                var fail = function (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        /*INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of PATH_EXISTS_ERR(code: 12)
-                        on trying to exclusively create a file or directory, which already exists (Chrome).*/
-                        //expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
+                    /* INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of PATH_EXISTS_ERR(code: 12)
+                    on trying to exclusively create a file or directory, which already exists (Chrome). */
+                    // expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
                     } else {
-                        expect(error).toBeFileError(FileError.PATH_EXISTS_ERR);
+                        expect(error).toBeFileError(FileError.PATH_EXISTS_ERR); // eslint-disable-line no-undef
                     }
                     // cleanup
                     deleteEntry(existingDir.name, done);
                 };
                 // create directory to kick off it
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, function (directory) {
                     existingDir = directory;
                     // create:true, exclusive:true, directory exists
                     root.getDirectory(dirName, {
-                        create : true,
-                        exclusive : true
+                        create: true,
+                        exclusive: true
                     }, failed.bind(null, done, 'root.getDirectory - Unexpected success callback, second directory should not be created : ' + dirName), fail);
                 }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.30 DirectoryEntry.getDirectory: get Entry for existing directory", function (done) {
-                var dirName = "de.get.dir",
-                dirPath = joinURL(root.fullPath, dirName),
-                win = function (directory) {
+            it('file.spec.30 DirectoryEntry.getDirectory: get Entry for existing directory', function (done) {
+                var dirName = 'de.get.dir';
+                var dirPath = joinURL(root.fullPath, dirName);
+                var win = function (directory) {
                     expect(directory).toBeDefined();
                     expect(directory.isFile).toBe(false);
                     expect(directory.isDirectory).toBe(true);
@@ -799,121 +802,121 @@ exports.defineAutoTests = function () {
                 };
                 // create directory to kick it off
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, function () {
                     root.getDirectory(dirName, {
-                        create : false
+                        create: false
                     }, win, failed.bind(null, done, 'root.getDirectory - Error getting directory entry : ' + dirName));
                 }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.31 DirectoryEntry.getDirectory: get DirectoryEntry for invalid path", function (done) {
+            it('file.spec.31 DirectoryEntry.getDirectory: get DirectoryEntry for invalid path', function (done) {
                 if (isBrowser) {
-                    /*The plugin does not follow to ["8.3 Naming restrictions"]
-                    (http://www.w3.org/TR/2011/WD-file-system-api-20110419/#naming-restrictions).*/
+                    /* The plugin does not follow to ["8.3 Naming restrictions"]
+                    (http://www.w3.org/TR/2011/WD-file-system-api-20110419/#naming-restrictions). */
                     pending();
                 }
 
-                var dirName = "de:invalid:path",
-                fail = function (error) {
+                var dirName = 'de:invalid:path';
+                var fail = function (error) {
                     expect(error).toBeDefined();
-                    expect(error).toBeFileError(FileError.ENCODING_ERR);
+                    expect(error).toBeFileError(FileError.ENCODING_ERR); // eslint-disable-line no-undef
                     done();
                 };
                 // create:false, exclusive:false, invalid path
                 root.getDirectory(dirName, {
-                    create : false
+                    create: false
                 }, succeed.bind(null, done, 'root.getDirectory - Unexpected success callback, directory should not exists: ' + dirName), fail);
             });
-            it("file.spec.32 DirectoryEntry.getDirectory: get DirectoryEntry for existing file", function (done) {
-                var fileName = "de.existing.file",
-                existingFile,
-                fail = function (error) {
+            it('file.spec.32 DirectoryEntry.getDirectory: get DirectoryEntry for existing file', function (done) {
+                var fileName = 'de.existing.file';
+                var existingFile;
+                var fail = function (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        // chrome returns an unknown error with code 17
+                    // chrome returns an unknown error with code 17
                     } else {
-                        expect(error).toBeFileError(FileError.TYPE_MISMATCH_ERR);
+                        expect(error).toBeFileError(FileError.TYPE_MISMATCH_ERR); // eslint-disable-line no-undef
                     }
                     // cleanup
                     deleteEntry(existingFile.name, done);
                 };
                 // create file to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, function (file) {
                     existingFile = file;
                     root.getDirectory(fileName, {
-                        create : false
+                        create: false
                     }, succeed.bind(null, done, 'root.getDirectory - Unexpected success callback, directory should not exists: ' + fileName), fail);
                 }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName));
             });
-            it("file.spec.33 DirectoryEntry.getFile: get FileEntry for existing directory", function (done) {
-                var dirName = "de.existing.dir",
-                existingDir,
-                fail = function (error) {
+            it('file.spec.33 DirectoryEntry.getFile: get FileEntry for existing directory', function (done) {
+                var dirName = 'de.existing.dir';
+                var existingDir;
+                var fail = function (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        // chrome returns an unknown error with code 17
+                    // chrome returns an unknown error with code 17
                     } else {
-                        expect(error).toBeFileError(FileError.TYPE_MISMATCH_ERR);
+                        expect(error).toBeFileError(FileError.TYPE_MISMATCH_ERR); // eslint-disable-line no-undef
                     }
                     // cleanup
                     deleteEntry(existingDir.name, done);
                 };
                 // create directory to kick off it
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, function (directory) {
                     existingDir = directory;
                     root.getFile(dirName, {
-                        create : false
+                        create: false
                     }, succeed.bind(null, done, 'root.getFile - Unexpected success callback, file should not exists: ' + dirName), fail);
                 }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.34 DirectoryEntry.removeRecursively on directory", function (done) {
-                var dirName = "de.removeRecursively",
-                subDirName = "dir",
-                dirExists = function (error) {
+            it('file.spec.34 DirectoryEntry.removeRecursively on directory', function (done) {
+                var dirName = 'de.removeRecursively';
+                var subDirName = 'dir';
+                var dirExists = function (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                        expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                     } else {
-                        expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                        expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                     }
                     done();
                 };
                 // create a new directory entry to kick off it
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, function (entry) {
                     entry.getDirectory(subDirName, {
-                        create : true
+                        create: true
                     }, function (dir) {
                         entry.removeRecursively(function () {
                             root.getDirectory(dirName, {
-                                create : false
+                                create: false
                             }, succeed.bind(null, done, 'root.getDirectory - Unexpected success callback, directory should not exists: ' + dirName), dirExists);
                         }, failed.bind(null, done, 'entry.removeRecursively - Error removing directory recursively : ' + dirName));
                     }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + subDirName));
                 }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.35 createReader: create reader on existing directory", function () {
+            it('file.spec.35 createReader: create reader on existing directory', function () {
                 // create reader for root directory
                 var reader = root.createReader();
                 expect(reader).toBeDefined();
                 expect(typeof reader.readEntries).toBe('function');
             });
-            it("file.spec.36 removeRecursively on root file system", function (done) {
+            it('file.spec.36 removeRecursively on root file system', function (done) {
 
                 var remove = function (error) {
                     expect(error).toBeDefined();
                     if (isChrome) {
-                        /*INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of
+                        /* INVALID_MODIFICATION_ERR (code: 9) or ??? (code: 13) is thrown instead of
                         NO_MODIFICATION_ALLOWED_ERR(code: 6) on trying to call removeRecursively
-                        on the root file system (Chrome).*/
-                        //expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
+                        on the root file system (Chrome). */
+                        // expect(error).toBeFileError(FileError.INVALID_MODIFICATION_ERR);
                     } else {
-                        expect(error).toBeFileError(FileError.NO_MODIFICATION_ALLOWED_ERR);
+                        expect(error).toBeFileError(FileError.NO_MODIFICATION_ALLOWED_ERR); // eslint-disable-line no-undef
                     }
                     done();
                 };
@@ -922,10 +925,10 @@ exports.defineAutoTests = function () {
             });
         });
         describe('DirectoryReader interface', function () {
-            describe("readEntries", function () {
-                it("file.spec.37 should read contents of existing directory", function (done) {
-                    var reader,
-                    win = function (entries) {
+            describe('readEntries', function () {
+                it('file.spec.37 should read contents of existing directory', function (done) {
+                    var reader;
+                    var win = function (entries) {
                         expect(entries).toBeDefined();
                         expect(entries instanceof Array).toBe(true);
                         done();
@@ -935,14 +938,14 @@ exports.defineAutoTests = function () {
                     // read entries
                     reader.readEntries(win, failed.bind(null, done, 'reader.readEntries - Error reading entries'));
                 });
-                it("file.spec.37.1 should read contents of existing directory", function (done) {
-                    var dirName = 'readEntries.dir',
-                    fileName = 'readeEntries.file';
+                it('file.spec.37.1 should read contents of existing directory', function (done) {
+                    var dirName = 'readEntries.dir';
+                    var fileName = 'readeEntries.file';
                     root.getDirectory(dirName, {
-                        create : true
+                        create: true
                     }, function (directory) {
                         directory.getFile(fileName, {
-                            create : true
+                            create: true
                         }, function (fileEntry) {
                             var reader = directory.createReader();
                             reader.readEntries(function (entries) {
@@ -953,10 +956,9 @@ exports.defineAutoTests = function () {
                                 expect(entries[0].filesystem).not.toBe(null);
                                 if (isChrome) {
                                     // Slicing '[object {type}]' -> '{type}'
-                                    expect(entries[0].filesystem.toString().slice(8, -1)).toEqual("DOMFileSystem");
-                                }
-                                else {
-                                    expect(entries[0].filesystem instanceof FileSystem).toBe(true);
+                                    expect(entries[0].filesystem.toString().slice(8, -1)).toEqual('DOMFileSystem');
+                                } else {
+                                    expect(entries[0].filesystem instanceof FileSystem).toBe(true); // eslint-disable-line no-undef
                                 }
 
                                 // cleanup
@@ -965,54 +967,54 @@ exports.defineAutoTests = function () {
                         }, failed.bind(null, done, 'directory.getFile - Error creating file : ' + fileName));
                     }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
                 });
-                it("file.spec.109 should return an empty entry list on the second call", function (done) {
-                    var reader,
-                    fileName = 'test109.txt';
+                it('file.spec.109 should return an empty entry list on the second call', function (done) {
+                    var reader;
+                    var fileName = 'test109.txt';
                     // Add a file to ensure the root directory is non-empty and then read the contents of the directory.
                     root.getFile(fileName, {
-                        create : true
+                        create: true
                     }, function (entry) {
                         reader = root.createReader();
-                        //First read
+                        // First read
                         reader.readEntries(function (entries) {
                             expect(entries).toBeDefined();
                             expect(entries instanceof Array).toBe(true);
                             expect(entries.length).not.toBe(0);
-                            //Second read
+                            // Second read
                             reader.readEntries(function (entries_) {
                                 expect(entries_).toBeDefined();
                                 expect(entries_ instanceof Array).toBe(true);
                                 expect(entries_.length).toBe(0);
-                                //Clean up
+                                // Clean up
                                 deleteEntry(entry.name, done);
                             }, failed.bind(null, done, 'reader.readEntries - Error during SECOND reading of entries from [root] directory'));
                         }, failed.bind(null, done, 'reader.readEntries - Error during FIRST reading of entries from [root] directory'));
                     }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName));
                 });
             });
-            it("file.spec.38 should read contents of directory that has been removed", function (done) {
-                var dirName = "de.createReader.notfound";
+            it('file.spec.38 should read contents of directory that has been removed', function (done) {
+                var dirName = 'de.createReader.notfound';
                 // create a new directory entry to kick off it
                 root.getDirectory(dirName, {
-                    create : true
+                    create: true
                 }, function (directory) {
                     directory.removeRecursively(function () {
                         var reader = directory.createReader();
                         reader.readEntries(succeed.bind(null, done, 'reader.readEntries - Unexpected success callback, it should not read entries from deleted dir: ' + dirName), function (error) {
                             expect(error).toBeDefined();
                             if (isChrome) {
-                                expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                                expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                             } else {
-                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                             }
                             root.getDirectory(dirName, {
-                                create : false
+                                create: false
                             }, succeed.bind(null, done, 'root.getDirectory - Unexpected success callback, it should not get deleted directory: ' + dirName), function (err) {
                                 expect(err).toBeDefined();
                                 if (isChrome) {
-                                    expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                                    expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                                 } else {
-                                    expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                                    expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                                 }
                                 done();
                             });
@@ -1021,26 +1023,26 @@ exports.defineAutoTests = function () {
                 }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName));
             });
         });
-        //DirectoryReader interface
+        // DirectoryReader interface
         describe('File', function () {
-            it("file.spec.39 constructor should be defined", function () {
-                expect(File).toBeDefined();
+            it('file.spec.39 constructor should be defined', function () {
+                expect(File).toBeDefined(); // eslint-disable-line no-undef
                 expect(typeof File).toBe('function');
             });
-            it("file.spec.40 should be define File attributes", function () {
-                var file = new File();
+            it('file.spec.40 should be define File attributes', function () {
+                var file = new File(); // eslint-disable-line no-undef
                 expect(file.name).toBeDefined();
                 expect(file.type).toBeDefined();
                 expect(file.lastModifiedDate).toBeDefined();
                 expect(file.size).toBeDefined();
             });
         });
-        //File
+        // File
         describe('FileEntry', function () {
 
-            it("file.spec.41 should be define FileEntry methods", function (done) {
-                var fileName = "fe.methods",
-                testFileEntry = function (fileEntry) {
+            it('file.spec.41 should be define FileEntry methods', function (done) {
+                var fileName = 'fe.methods';
+                var testFileEntry = function (fileEntry) {
                     expect(fileEntry).toBeDefined();
                     expect(typeof fileEntry.createWriter).toBe('function');
                     expect(typeof fileEntry.file).toBe('function');
@@ -1049,20 +1051,19 @@ exports.defineAutoTests = function () {
                 };
                 // create a new file entry to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, testFileEntry, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName));
             });
-            it("file.spec.42 createWriter should return a FileWriter object", function (done) {
-                var fileName = "fe.createWriter",
-                testFile,
-                testWriter = function (writer) {
+            it('file.spec.42 createWriter should return a FileWriter object', function (done) {
+                var fileName = 'fe.createWriter';
+                var testFile;
+                var testWriter = function (writer) {
                     expect(writer).toBeDefined();
                     if (isChrome) {
-                        // Slicing '[object {type}]' -> '{type}'
-                        expect(writer.toString().slice(8, -1)).toEqual("FileWriter");
-                    }
-                    else {
-                        expect(writer instanceof FileWriter).toBe(true);
+                    // Slicing '[object {type}]' -> '{type}'
+                        expect(writer.toString().slice(8, -1)).toEqual('FileWriter');
+                    } else {
+                        expect(writer instanceof FileWriter).toBe(true); // eslint-disable-line no-undef
                     }
 
                     // cleanup
@@ -1070,23 +1071,22 @@ exports.defineAutoTests = function () {
                 };
                 // create a new file entry to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, function (fileEntry) {
                     testFile = fileEntry;
                     fileEntry.createWriter(testWriter, failed.bind(null, done, 'fileEntry.createWriter - Error creating Writer from entry'));
                 }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName));
             });
-            it("file.spec.43 file should return a File object", function (done) {
-                var fileName = "fe.file",
-                newFile,
-                testFile = function (file) {
+            it('file.spec.43 file should return a File object', function (done) {
+                var fileName = 'fe.file';
+                var newFile;
+                var testFile = function (file) {
                     expect(file).toBeDefined();
                     if (isChrome) {
-                        // Slicing '[object {type}]' -> '{type}'
-                        expect(file.toString().slice(8, -1)).toEqual("File");
-                    }
-                    else {
-                        expect(file instanceof File).toBe(true);
+                    // Slicing '[object {type}]' -> '{type}'
+                        expect(file.toString().slice(8, -1)).toEqual('File');
+                    } else {
+                        expect(file instanceof File).toBe(true); // eslint-disable-line no-undef
                     }
 
                     // cleanup
@@ -1094,25 +1094,25 @@ exports.defineAutoTests = function () {
                 };
                 // create a new file entry to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, function (fileEntry) {
                     newFile = fileEntry;
                     fileEntry.file(testFile, failed.bind(null, done, 'fileEntry.file - Error reading file using fileEntry: ' + fileEntry.name));
                 }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName));
             });
-            it("file.spec.44 file: on File that has been removed", function (done) {
-                var fileName = "fe.no.file";
+            it('file.spec.44 file: on File that has been removed', function (done) {
+                var fileName = 'fe.no.file';
                 // create a new file entry to kick off it
                 root.getFile(fileName, {
-                    create : true
+                    create: true
                 }, function (fileEntry) {
                     fileEntry.remove(function () {
                         fileEntry.file(succeed.bind(null, done, 'fileEntry.file - Unexpected success callback, file it should not be created from removed entry'), function (error) {
                             expect(error).toBeDefined();
                             if (isChrome) {
-                                expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                                expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                             } else {
-                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                             }
                             done();
                         });
@@ -1120,12 +1120,12 @@ exports.defineAutoTests = function () {
                 }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName));
             });
         });
-        //FileEntry
+        // FileEntry
         describe('Entry', function () {
-            it("file.spec.45 Entry object", function (done) {
-                var fileName = "entry",
-                fullPath = joinURL(root.fullPath, fileName),
-                winEntry = function (entry) {
+            it('file.spec.45 Entry object', function (done) {
+                var fileName = 'entry';
+                var fullPath = joinURL(root.fullPath, fileName);
+                var winEntry = function (entry) {
                     expect(entry).toBeDefined();
                     expect(entry.isFile).toBe(true);
                     expect(entry.isDirectory).toBe(false);
@@ -1146,41 +1146,41 @@ exports.defineAutoTests = function () {
                 // create a new file entry
                 createFile(fileName, winEntry, failed.bind(null, done, 'createFile - Error creating file : ' + fileName));
             });
-            it("file.spec.46 Entry.getMetadata on file", function (done) {
-                var fileName = "entry.metadata.file";
+            it('file.spec.46 Entry.getMetadata on file', function (done) {
+                var fileName = 'entry.metadata.file';
                 // create a new file entry
                 createFile(fileName, function (entry) {
                     entry.getMetadata(function (metadata) {
                         expect(metadata).toBeDefined();
                         expect(metadata.modificationTime instanceof Date).toBe(true);
-                        expect(typeof metadata.size).toBe("number");
+                        expect(typeof metadata.size).toBe('number');
                         // cleanup
                         deleteEntry(fileName, done);
                     }, failed.bind(null, done, 'entry.getMetadata - Error getting metadata from entry : ' + fileName));
                 }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName));
             });
-            it("file.spec.47 Entry.getMetadata on directory", function (done) {
+            it('file.spec.47 Entry.getMetadata on directory', function (done) {
                 if (isIndexedDBShim) {
                     /* Does not support metadata for directories (Firefox, IE) */
                     pending();
                 }
 
-                var dirName = "entry.metadata.dir";
+                var dirName = 'entry.metadata.dir';
                 // create a new directory entry
                 createDirectory(dirName, function (entry) {
                     entry.getMetadata(function (metadata) {
                         expect(metadata).toBeDefined();
                         expect(metadata.modificationTime instanceof Date).toBe(true);
-                        expect(typeof metadata.size).toBe("number");
+                        expect(typeof metadata.size).toBe('number');
                         expect(metadata.size).toBe(0);
                         // cleanup
                         deleteEntry(dirName, done);
                     }, failed.bind(null, done, 'entry.getMetadata - Error getting metadata from entry : ' + dirName));
                 }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.48 Entry.getParent on file in root file system", function (done) {
-                var fileName = "entry.parent.file",
-                rootPath = root.fullPath;
+            it('file.spec.48 Entry.getParent on file in root file system', function (done) {
+                var fileName = 'entry.parent.file';
+                var rootPath = root.fullPath;
                 // create a new file entry
                 createFile(fileName, function (entry) {
                     entry.getParent(function (parent) {
@@ -1191,9 +1191,9 @@ exports.defineAutoTests = function () {
                     }, failed.bind(null, done, 'entry.getParent - Error getting parent directory of file : ' + fileName));
                 }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName));
             });
-            it("file.spec.49 Entry.getParent on directory in root file system", function (done) {
-                var dirName = "entry.parent.dir",
-                rootPath = root.fullPath;
+            it('file.spec.49 Entry.getParent on directory in root file system', function (done) {
+                var dirName = 'entry.parent.dir';
+                var rootPath = root.fullPath;
                 // create a new directory entry
                 createDirectory(dirName, function (entry) {
                     entry.getParent(function (parent) {
@@ -1204,9 +1204,9 @@ exports.defineAutoTests = function () {
                     }, failed.bind(null, done, 'entry.getParent - Error getting parent directory of directory : ' + dirName));
                 }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.50 Entry.getParent on root file system", function (done) {
-                var rootPath = root.fullPath,
-                winParent = function (parent) {
+            it('file.spec.50 Entry.getParent on root file system', function (done) {
+                var rootPath = root.fullPath;
+                var winParent = function (parent) {
                     expect(parent).toBeDefined();
                     expect(parent.fullPath).toCanonicallyMatch(rootPath);
                     done();
@@ -1214,10 +1214,10 @@ exports.defineAutoTests = function () {
                 // create a new directory entry
                 root.getParent(winParent, failed.bind(null, done, 'root.getParent - Error getting parent directory of root'));
             });
-            it("file.spec.51 Entry.toURL on file", function (done) {
-                var fileName = "entry.uri.file",
-                rootPath = root.fullPath,
-                winURI = function (entry) {
+            it('file.spec.51 Entry.toURL on file', function (done) {
+                var fileName = 'entry.uri.file';
+                var rootPath = root.fullPath;
+                var winURI = function (entry) {
                     var uri = entry.toURL();
                     expect(uri).toBeDefined();
                     expect(uri.indexOf(rootPath)).not.toBe(-1);
@@ -1227,13 +1227,13 @@ exports.defineAutoTests = function () {
                 // create a new file entry
                 createFile(fileName, winURI, failed.bind(null, done, 'createFile - Error creating file : ' + fileName));
             });
-            it("file.spec.52 Entry.toURL on directory", function (done) {
-                var dirName_1 = "num 1",
-                dirName_2 = "num 2",
-                rootPath = root.fullPath;
+            it('file.spec.52 Entry.toURL on directory', function (done) {
+                var dirName_1 = 'num 1';
+                var dirName_2 = 'num 2';
+                var rootPath = root.fullPath;
                 createDirectory(dirName_1, function (entry) {
                     entry.getDirectory(dirName_2, {
-                        create : true
+                        create: true
                     }, function (entryFile) {
                         var uri = entryFile.toURL();
                         expect(uri).toBeDefined();
@@ -1244,8 +1244,8 @@ exports.defineAutoTests = function () {
                     }, failed.bind(null, done, 'entry.getDirectory - Error creating directory : ' + dirName_2));
                 }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName_1));
             });
-            it("file.spec.53 Entry.remove on file", function (done) {
-                var fileName = "entr .rm.file";
+            it('file.spec.53 Entry.remove on file', function (done) {
+                var fileName = 'entr .rm.file';
                 // create a new file entry
                 createFile(fileName, function (entry) {
                     expect(entry).toBeDefined();
@@ -1253,9 +1253,9 @@ exports.defineAutoTests = function () {
                         root.getFile(fileName, null, succeed.bind(null, done, 'root.getFile - Unexpected success callback, it should not get deleted file : ' + fileName), function (error) {
                             expect(error).toBeDefined();
                             if (isChrome) {
-                                expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                                expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                             } else {
-                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                             }
                             // cleanup
                             deleteEntry(fileName, done);
@@ -1263,26 +1263,26 @@ exports.defineAutoTests = function () {
                     }, failed.bind(null, done, 'entry.remove - Error removing entry : ' + fileName));
                 }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName));
             });
-            it("file.spec.53.1 Entry.remove on filename with #s", function (done) {
+            it('file.spec.53.1 Entry.remove on filename with #s', function (done) {
                 if (isBrowser) {
                     pending('Browsers can\'t do that');
                 }
-                var fileName = "entry.#rm#.file";
+                var fileName = 'entry.#rm#.file';
                 // create a new file entry
                 createFile(fileName, function (entry) {
                     expect(entry).toBeDefined();
                     entry.remove(function () {
                         root.getFile(fileName, null, succeed.bind(null, done, 'root.getFile - Unexpected success callback, it should not get deleted file : ' + fileName), function (error) {
                             expect(error).toBeDefined();
-                            expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                            expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                             // cleanup
                             deleteEntry(fileName, done);
                         });
                     }, failed.bind(null, done, 'entry.remove - Error removing entry : ' + fileName));
                 }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName));
             });
-            it("file.spec.54 remove on empty directory", function (done) {
-                var dirName = "entry.rm.dir";
+            it('file.spec.54 remove on empty directory', function (done) {
+                var dirName = 'entry.rm.dir';
                 // create a new directory entry
                 createDirectory(dirName, function (entry) {
                     expect(entry).toBeDefined();
@@ -1290,9 +1290,9 @@ exports.defineAutoTests = function () {
                         root.getDirectory(dirName, null, succeed.bind(null, done, 'root.getDirectory - Unexpected success callback, it should not get deleted directory : ' + dirName), function (error) {
                             expect(error).toBeDefined();
                             if (isChrome) {
-                                expect(error).toBeFileError(FileError.SYNTAX_ERR);
+                                expect(error).toBeFileError(FileError.SYNTAX_ERR); // eslint-disable-line no-undef
                             } else {
-                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR);
+                                expect(error).toBeFileError(FileError.NOT_FOUND_ERR); // eslint-disable-line no-undef
                             }
                             // cleanup
                             deleteEntry(dirName, done);
@@ -1300,28 +1300,28 @@ exports.defineAutoTests = function () {
                     }, failed.bind(null, done, 'entry.remove - Error removing entry : ' + dirName));
                 }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName));
             });
-            it("file.spec.55 remove on non-empty directory", function (done) {
+            it('file.spec.55 remove on non-empty directory', function (done) {
                 if (isIndexedDBShim) {
                     /* Both Entry.remove and directoryEntry.removeRecursively don't fail when removing
                     non-empty directories - directories being removed are cleaned
-                    along with contents instead (Firefox, IE)*/
+                    along with contents instead (Firefox, IE) */
                     pending();
                 }
 
-                var dirName = "ent y.rm.dir.not.empty",
-                fileName = "re ove.txt",
-                fullPath = joinURL(root.fullPath, dirName);
+                var dirName = 'ent y.rm.dir.not.empty';
+                var fileName = 're ove.txt';
+                var fullPath = joinURL(root.fullPath, dirName);
                 // create a new directory entry
                 createDirectory(dirName, function (entry) {
                     entry.getFile(fileName, {
-                        create : true
+                        create: true

<TRUNCATED>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[5/5] cordova-plugin-file git commit: CB-12895 : setup eslint and took out jshint

Posted by au...@apache.org.
CB-12895 : setup eslint and took out jshint


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/07557e02
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/07557e02
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/07557e02

Branch: refs/heads/master
Commit: 07557e02a6ae58cf54d4c96e5ea89d6180ab7782
Parents: b514aaf
Author: Audrey So <au...@apache.org>
Authored: Fri Jun 9 16:06:08 2017 -0700
Committer: Audrey So <au...@apache.org>
Committed: Wed Aug 23 09:38:32 2017 -0700

----------------------------------------------------------------------
 .eslintrc.yml                                 |   10 +
 package.json                                  |   12 +-
 src/blackberry10/index.js                     |   24 +-
 src/browser/FileProxy.js                      |  354 ++--
 src/firefoxos/FileProxy.js                    |  272 +--
 src/windows/FileProxy.js                      |  625 +++---
 tests/tests.js                                | 2158 ++++++++++----------
 www/DirectoryEntry.js                         |   42 +-
 www/DirectoryReader.js                        |   19 +-
 www/Entry.js                                  |  132 +-
 www/File.js                                   |    5 +-
 www/FileEntry.js                              |   29 +-
 www/FileError.js                              |    4 +-
 www/FileReader.js                             |  109 +-
 www/FileSystem.js                             |   10 +-
 www/FileUploadOptions.js                      |    2 +-
 www/FileUploadResult.js                       |   10 +-
 www/FileWriter.js                             |  106 +-
 www/Flags.js                                  |    2 +-
 www/Metadata.js                               |    6 +-
 www/ProgressEvent.js                          |   24 +-
 www/android/FileSystem.js                     |   11 +-
 www/blackberry10/FileSystem.js                |   27 +-
 www/blackberry10/copyTo.js                    |   56 +-
 www/blackberry10/createEntryFromNative.js     |   42 +-
 www/blackberry10/getDirectory.js              |   57 +-
 www/blackberry10/getFile.js                   |   30 +-
 www/blackberry10/getFileMetadata.js           |   37 +-
 www/blackberry10/getMetadata.js               |   32 +-
 www/blackberry10/getParent.js                 |   37 +-
 www/blackberry10/info.js                      |   10 +-
 www/blackberry10/moveTo.js                    |    6 +-
 www/blackberry10/readAsArrayBuffer.js         |   46 +-
 www/blackberry10/readAsBinaryString.js        |   46 +-
 www/blackberry10/readAsDataURL.js             |   43 +-
 www/blackberry10/readAsText.js                |   51 +-
 www/blackberry10/readEntries.js               |   64 +-
 www/blackberry10/remove.js                    |   40 +-
 www/blackberry10/removeRecursively.js         |   46 +-
 www/blackberry10/requestAllFileSystems.js     |    4 +-
 www/blackberry10/requestAnimationFrame.js     |    6 +-
 www/blackberry10/requestFileSystem.js         |   22 +-
 www/blackberry10/resolveLocalFileSystemURI.js |   93 +-
 www/blackberry10/setMetadata.js               |   10 +-
 www/blackberry10/truncate.js                  |   46 +-
 www/blackberry10/write.js                     |   51 +-
 www/browser/FileSystem.js                     |    9 +-
 www/browser/Preparing.js                      |   72 +-
 www/fileSystemPaths.js                        |    5 +-
 www/fileSystems-roots.js                      |    7 +-
 www/fileSystems.js                            |    2 +-
 www/firefoxos/FileSystem.js                   |    7 +-
 www/ios/FileSystem.js                         |    9 +-
 www/osx/FileSystem.js                         |    9 +-
 www/requestFileSystem.js                      |   29 +-
 www/resolveLocalFileSystemURI.js              |   45 +-
 www/ubuntu/FileSystem.js                      |    9 +-
 www/ubuntu/FileWriter.js                      |   61 +-
 www/ubuntu/fileSystems-roots.js               |   13 +-
 www/wp/FileUploadOptions.js                   |   13 +-
 60 files changed, 2587 insertions(+), 2571 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/.eslintrc.yml
----------------------------------------------------------------------
diff --git a/.eslintrc.yml b/.eslintrc.yml
new file mode 100644
index 0000000..0cccb8c
--- /dev/null
+++ b/.eslintrc.yml
@@ -0,0 +1,10 @@
+root: true
+extends: semistandard
+rules:
+  indent:
+    - error
+    - 4
+  camelcase: off
+  padded-blocks: off
+  operator-linebreak: off
+  no-throw-literal: off
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 8d25378..1747782 100644
--- a/package.json
+++ b/package.json
@@ -43,8 +43,8 @@
     "cordova-firefoxos"
   ],
   "scripts": {
-    "test": "npm run jshint",
-    "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests"
+    "test": "npm run eslint",
+    "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests"
   },
   "author": "Apache Software Foundation",
   "license": "Apache-2.0",
@@ -56,6 +56,12 @@
     }
   },
   "devDependencies": {
-    "jshint": "^2.6.0"
+    "eslint": "^3.19.0",
+    "eslint-config-semistandard": "^11.0.0",
+    "eslint-config-standard": "^10.2.1",
+    "eslint-plugin-import": "^2.3.0",
+    "eslint-plugin-node": "^5.0.0",
+    "eslint-plugin-promise": "^3.5.0",
+    "eslint-plugin-standard": "^3.0.1"
   }
 }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
index e995986..c5d8837 100644
--- a/src/blackberry10/index.js
+++ b/src/blackberry10/index.js
@@ -22,26 +22,26 @@
 /* global PluginResult */
 
 module.exports = {
-    setSandbox : function (success, fail, args, env) {
-        require("lib/webview").setSandbox(JSON.parse(decodeURIComponent(args[0])));
+    setSandbox: function (success, fail, args, env) {
+        require('lib/webview').setSandbox(JSON.parse(decodeURIComponent(args[0])));
         new PluginResult(args, env).ok();
     },
 
     getHomePath: function (success, fail, args, env) {
-        var homeDir = window.qnx.webplatform.getApplication().getEnv("HOME");
+        var homeDir = window.qnx.webplatform.getApplication().getEnv('HOME');
         new PluginResult(args, env).ok(homeDir);
     },
 
     requestAllPaths: function (success, fail, args, env) {
-        var homeDir = 'file://' + window.qnx.webplatform.getApplication().getEnv("HOME").replace('/data', ''),
-            paths = {
-                applicationDirectory: homeDir + '/app/native/',
-                applicationStorageDirectory: homeDir + '/',
-                dataDirectory: homeDir + '/data/webviews/webfs/persistent/local__0/',
-                cacheDirectory: homeDir + '/data/webviews/webfs/temporary/local__0/',
-                externalRootDirectory: 'file:///accounts/1000/removable/sdcard/',
-                sharedDirectory: homeDir + '/shared/'
-            };
+        var homeDir = 'file://' + window.qnx.webplatform.getApplication().getEnv('HOME').replace('/data', '');
+        var paths = {
+            applicationDirectory: homeDir + '/app/native/',
+            applicationStorageDirectory: homeDir + '/',
+            dataDirectory: homeDir + '/data/webviews/webfs/persistent/local__0/',
+            cacheDirectory: homeDir + '/data/webviews/webfs/temporary/local__0/',
+            externalRootDirectory: 'file:///accounts/1000/removable/sdcard/',
+            sharedDirectory: homeDir + '/shared/'
+        };
         success(paths);
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/src/browser/FileProxy.js
----------------------------------------------------------------------
diff --git a/src/browser/FileProxy.js b/src/browser/FileProxy.js
index 2d937f4..66ad46b 100644
--- a/src/browser/FileProxy.js
+++ b/src/browser/FileProxy.js
@@ -18,10 +18,10 @@
  * under the License.
  *
  */
-(function() {
-    /*global require, exports, module*/
-    /*global FILESYSTEM_PREFIX*/
-    /*global IDBKeyRange*/
+(function () {
+    /* global require, exports, module */
+    /* global FILESYSTEM_PREFIX */
+    /* global IDBKeyRange */
 
     /* Heavily based on https://github.com/ebidel/idb.filesystem.js */
 
@@ -30,33 +30,33 @@
     if (require('./isChrome')()) {
         var pathsPrefix = {
             // Read-only directory where the application is installed.
-            applicationDirectory: location.origin + "/",
+            applicationDirectory: location.origin + '/', // eslint-disable-line no-undef
             // Where to put app-specific data files.
             dataDirectory: 'filesystem:file:///persistent/',
             // Cached files that should survive app restarts.
             // Apps should not rely on the OS to delete files in here.
-            cacheDirectory: 'filesystem:file:///temporary/',
+            cacheDirectory: 'filesystem:file:///temporary/'
         };
 
-        exports.requestAllPaths = function(successCallback) {
+        exports.requestAllPaths = function (successCallback) {
             successCallback(pathsPrefix);
         };
 
-        require("cordova/exec/proxy").add("File", module.exports);
+        require('cordova/exec/proxy').add('File', module.exports);
         return;
     }
 
-    var LocalFileSystem = require('./LocalFileSystem'),
-        FileSystem = require('./FileSystem'),
-        FileEntry = require('./FileEntry'),
-        FileError = require('./FileError'),
-        DirectoryEntry = require('./DirectoryEntry'),
-        File = require('./File');
+    var LocalFileSystem = require('./LocalFileSystem');
+    var FileSystem = require('./FileSystem');
+    var FileEntry = require('./FileEntry');
+    var FileError = require('./FileError');
+    var DirectoryEntry = require('./DirectoryEntry');
+    var File = require('./File');
 
-    (function(exports, global) {
+    (function (exports, global) {
         var indexedDB = global.indexedDB || global.mozIndexedDB;
         if (!indexedDB) {
-            throw "Firefox OS File plugin: indexedDB not supported";
+            throw 'Firefox OS File plugin: indexedDB not supported';
         }
 
         var fs_ = null;
@@ -69,23 +69,23 @@
 
         var pathsPrefix = {
             // Read-only directory where the application is installed.
-            applicationDirectory: location.origin + "/",
+            applicationDirectory: location.origin + '/', // eslint-disable-line no-undef
             // Where to put app-specific data files.
             dataDirectory: 'file:///persistent/',
             // Cached files that should survive app restarts.
             // Apps should not rely on the OS to delete files in here.
-            cacheDirectory: 'file:///temporary/',
+            cacheDirectory: 'file:///temporary/'
         };
 
         var unicodeLastChar = 65535;
 
-    /*** Exported functionality ***/
+    /** * Exported functionality ***/
 
-        exports.requestFileSystem = function(successCallback, errorCallback, args) {
+        exports.requestFileSystem = function (successCallback, errorCallback, args) {
             var type = args[0];
             // Size is ignored since IDB filesystem size depends
             // on browser implementation and can't be set up by user
-            var size = args[1]; // jshint ignore: line
+            var size = args[1]; // eslint-disable-line no-unused-vars
 
             if (type !== LocalFileSystem.TEMPORARY && type !== LocalFileSystem.PERSISTENT) {
                 if (errorCallback) {
@@ -95,23 +95,23 @@
             }
 
             var name = type === LocalFileSystem.TEMPORARY ? 'temporary' : 'persistent';
-            var storageName = (location.protocol + location.host).replace(/:/g, '_');
+            var storageName = (location.protocol + location.host).replace(/:/g, '_'); // eslint-disable-line no-undef
 
             var root = new DirectoryEntry('', DIR_SEPARATOR);
             fs_ = new FileSystem(name, root);
 
-            idb_.open(storageName, function() {
+            idb_.open(storageName, function () {
                 successCallback(fs_);
             }, errorCallback);
         };
 
         // Overridden by Android, BlackBerry 10 and iOS to populate fsMap
-        require('./fileSystems').getFs = function(name, callback) {
+        require('./fileSystems').getFs = function (name, callback) {
             callback(new FileSystem(name, fs_.root));
         };
 
         // list a directory's contents (files and folders).
-        exports.readEntries = function(successCallback, errorCallback, args) {
+        exports.readEntries = function (successCallback, errorCallback, args) {
             var fullPath = args[0];
 
             if (typeof successCallback !== 'function') {
@@ -120,18 +120,18 @@
 
             var path = resolveToFullPath_(fullPath);
 
-            exports.getDirectory(function() {
-                idb_.getAllEntries(path.fullPath + DIR_SEPARATOR, path.storagePath, function(entries) {
+            exports.getDirectory(function () {
+                idb_.getAllEntries(path.fullPath + DIR_SEPARATOR, path.storagePath, function (entries) {
                     successCallback(entries);
                 }, errorCallback);
-            }, function() {
+            }, function () {
                 if (errorCallback) {
                     errorCallback(FileError.NOT_FOUND_ERR);
                 }
             }, [path.storagePath, path.fullPath, {create: false}]);
         };
 
-        exports.getFile = function(successCallback, errorCallback, args) {
+        exports.getFile = function (successCallback, errorCallback, args) {
             var fullPath = args[0];
             var path = args[1];
             var options = args[2] || {};
@@ -139,7 +139,7 @@
             // Create an absolute path if we were handed a relative one.
             path = resolveToFullPath_(fullPath, path);
 
-            idb_.get(path.storagePath, function(fileEntry) {
+            idb_.get(path.storagePath, function (fileEntry) {
                 if (options.create === true && options.exclusive === true && fileEntry) {
                     // If create and exclusive are both true, and the path already exists,
                     // getFile must fail.
@@ -164,7 +164,7 @@
                 } else if (options.create === true && fileEntry) {
                     if (fileEntry.isFile) {
                         // Overwrite file, delete then create new.
-                        idb_['delete'](path.storagePath, function() {
+                        idb_['delete'](path.storagePath, function () {
                             var newFileEntry = new FileEntry(path.fileName, path.fullPath, new FileSystem(path.fsName, fs_.root));
 
                             newFileEntry.file_ = new MyFile({
@@ -202,16 +202,16 @@
             }, errorCallback);
         };
 
-        exports.getFileMetadata = function(successCallback, errorCallback, args) {
+        exports.getFileMetadata = function (successCallback, errorCallback, args) {
             var fullPath = args[0];
 
-            exports.getFile(function(fileEntry) {
+            exports.getFile(function (fileEntry) {
                 successCallback(new File(fileEntry.file_.name, fileEntry.fullPath, '', fileEntry.file_.lastModifiedDate,
                     fileEntry.file_.size));
             }, errorCallback, [fullPath, null]);
         };
 
-        exports.getMetadata = function(successCallback, errorCallback, args) {
+        exports.getMetadata = function (successCallback, errorCallback, args) {
             exports.getFile(function (fileEntry) {
                 successCallback(
                     {
@@ -221,21 +221,21 @@
             }, errorCallback, args);
         };
 
-        exports.setMetadata = function(successCallback, errorCallback, args) {
+        exports.setMetadata = function (successCallback, errorCallback, args) {
             var fullPath = args[0];
             var metadataObject = args[1];
 
             exports.getFile(function (fileEntry) {
-                  fileEntry.file_.lastModifiedDate = metadataObject.modificationTime;
-                  idb_.put(fileEntry, fileEntry.file_.storagePath, successCallback, errorCallback);
+                fileEntry.file_.lastModifiedDate = metadataObject.modificationTime;
+                idb_.put(fileEntry, fileEntry.file_.storagePath, successCallback, errorCallback);
             }, errorCallback, [fullPath, null]);
         };
 
-        exports.write = function(successCallback, errorCallback, args) {
-            var fileName = args[0],
-                data = args[1],
-                position = args[2],
-                isBinary = args[3]; // jshint ignore: line
+        exports.write = function (successCallback, errorCallback, args) {
+            var fileName = args[0];
+            var data = args[1];
+            var position = args[2];
+            var isBinary = args[3]; // eslint-disable-line no-unused-vars
 
             if (!data) {
                 if (errorCallback) {
@@ -245,14 +245,14 @@
             }
 
             if (typeof data === 'string' || data instanceof String) {
-                data = new Blob([data]);
+                data = new Blob([data]); // eslint-disable-line no-undef
             }
 
-            exports.getFile(function(fileEntry) {
+            exports.getFile(function (fileEntry) {
                 var blob_ = fileEntry.file_.blob_;
 
                 if (!blob_) {
-                    blob_ = new Blob([data], {type: data.type});
+                    blob_ = new Blob([data], {type: data.type}); // eslint-disable-line no-undef
                 } else {
                     // Calc the head and tail fragments
                     var head = blob_.slice(0, position);
@@ -265,7 +265,7 @@
                     }
 
                     // Do the "write". In fact, a full overwrite of the Blob.
-                    blob_ = new Blob([head, new Uint8Array(padding), data, tail],
+                    blob_ = new Blob([head, new Uint8Array(padding), data, tail], // eslint-disable-line no-undef
                         {type: data.type});
                 }
 
@@ -276,46 +276,46 @@
                 fileEntry.file_.name = blob_.name;
                 fileEntry.file_.type = blob_.type;
 
-                idb_.put(fileEntry, fileEntry.file_.storagePath, function() {
+                idb_.put(fileEntry, fileEntry.file_.storagePath, function () {
                     successCallback(data.size || data.byteLength);
                 }, errorCallback);
             }, errorCallback, [fileName, null]);
         };
 
-        exports.readAsText = function(successCallback, errorCallback, args) {
-            var fileName = args[0],
-                enc = args[1],
-                startPos = args[2],
-                endPos = args[3];
+        exports.readAsText = function (successCallback, errorCallback, args) {
+            var fileName = args[0];
+            var enc = args[1];
+            var startPos = args[2];
+            var endPos = args[3];
 
             readAs('text', fileName, enc, startPos, endPos, successCallback, errorCallback);
         };
 
-        exports.readAsDataURL = function(successCallback, errorCallback, args) {
-            var fileName = args[0],
-                startPos = args[1],
-                endPos = args[2];
+        exports.readAsDataURL = function (successCallback, errorCallback, args) {
+            var fileName = args[0];
+            var startPos = args[1];
+            var endPos = args[2];
 
             readAs('dataURL', fileName, null, startPos, endPos, successCallback, errorCallback);
         };
 
-        exports.readAsBinaryString = function(successCallback, errorCallback, args) {
-            var fileName = args[0],
-                startPos = args[1],
-                endPos = args[2];
+        exports.readAsBinaryString = function (successCallback, errorCallback, args) {
+            var fileName = args[0];
+            var startPos = args[1];
+            var endPos = args[2];
 
             readAs('binaryString', fileName, null, startPos, endPos, successCallback, errorCallback);
         };
 
-        exports.readAsArrayBuffer = function(successCallback, errorCallback, args) {
-            var fileName = args[0],
-                startPos = args[1],
-                endPos = args[2];
+        exports.readAsArrayBuffer = function (successCallback, errorCallback, args) {
+            var fileName = args[0];
+            var startPos = args[1];
+            var endPos = args[2];
 
             readAs('arrayBuffer', fileName, null, startPos, endPos, successCallback, errorCallback);
         };
 
-        exports.removeRecursively = exports.remove = function(successCallback, errorCallback, args) {
+        exports.removeRecursively = exports.remove = function (successCallback, errorCallback, args) {
             if (typeof successCallback !== 'function') {
                 throw Error('Expected successCallback argument.');
             }
@@ -326,26 +326,26 @@
                 return;
             }
 
-            function deleteEntry(isDirectory) {
+            function deleteEntry (isDirectory) {
                 // TODO: This doesn't protect against directories that have content in it.
                 // Should throw an error instead if the dirEntry is not empty.
-                idb_['delete'](fullPath, function() {
+                idb_['delete'](fullPath, function () {
                     successCallback();
-                }, function() {
-                        if (errorCallback) { errorCallback(); }
+                }, function () {
+                    if (errorCallback) { errorCallback(); }
                 }, isDirectory);
             }
 
             // We need to to understand what we are deleting:
-            exports.getDirectory(function(entry) {
+            exports.getDirectory(function (entry) {
                 deleteEntry(entry.isDirectory);
-            }, function(){
-                //DirectoryEntry was already deleted or entry is FileEntry
+            }, function () {
+                // DirectoryEntry was already deleted or entry is FileEntry
                 deleteEntry(false);
             }, [fullPath, null, {create: false}]);
         };
 
-        exports.getDirectory = function(successCallback, errorCallback, args) {
+        exports.getDirectory = function (successCallback, errorCallback, args) {
             var fullPath = args[0];
             var path = args[1];
             var options = args[2];
@@ -353,7 +353,7 @@
             // Create an absolute path if we were handed a relative one.
             path = resolveToFullPath_(fullPath, path);
 
-            idb_.get(path.storagePath, function(folderEntry) {
+            idb_.get(path.storagePath, function (folderEntry) {
                 if (!options) {
                     options = {};
                 }
@@ -423,15 +423,15 @@
             }, errorCallback);
         };
 
-        exports.getParent = function(successCallback, errorCallback, args) {
+        exports.getParent = function (successCallback, errorCallback, args) {
             if (typeof successCallback !== 'function') {
                 throw Error('Expected successCallback argument.');
             }
 
             var fullPath = args[0];
-            //fullPath is like this:
-            //file:///persistent/path/to/file or
-            //file:///persistent/path/to/directory/
+            // fullPath is like this:
+            // file:///persistent/path/to/file or
+            // file:///persistent/path/to/directory/
 
             if (fullPath === DIR_SEPARATOR || fullPath === pathsPrefix.cacheDirectory ||
                 fullPath === pathsPrefix.dataDirectory) {
@@ -439,7 +439,7 @@
                 return;
             }
 
-            //To delete all slashes at the end
+            // To delete all slashes at the end
             while (fullPath[fullPath.length - 1] === '/') {
                 fullPath = fullPath.substr(0, fullPath.length - 1);
             }
@@ -449,8 +449,8 @@
             var parentName = pathArr.pop();
             var path = pathArr.join(DIR_SEPARATOR) + DIR_SEPARATOR;
 
-            //To get parent of root files
-            var joined = path + parentName + DIR_SEPARATOR;//is like this: file:///persistent/
+            // To get parent of root files
+            var joined = path + parentName + DIR_SEPARATOR;// is like this: file:///persistent/
             if (joined === pathsPrefix.cacheDirectory || joined === pathsPrefix.dataDirectory) {
                 exports.getDirectory(successCallback, errorCallback, [joined, DIR_SEPARATOR, {create: false}]);
                 return;
@@ -459,7 +459,7 @@
             exports.getDirectory(successCallback, errorCallback, [path, parentName, {create: false}]);
         };
 
-        exports.copyTo = function(successCallback, errorCallback, args) {
+        exports.copyTo = function (successCallback, errorCallback, args) {
             var srcPath = args[0];
             var parentFullPath = args[1];
             var name = args[2];
@@ -473,33 +473,33 @@
             }
 
             // Read src file
-            exports.getFile(function(srcFileEntry) {
+            exports.getFile(function (srcFileEntry) {
 
                 var path = resolveToFullPath_(parentFullPath);
-                //Check directory
-                exports.getDirectory(function() {
+                // Check directory
+                exports.getDirectory(function () {
 
                     // Create dest file
-                    exports.getFile(function(dstFileEntry) {
+                    exports.getFile(function (dstFileEntry) {
 
-                        exports.write(function() {
+                        exports.write(function () {
                             successCallback(dstFileEntry);
                         }, errorCallback, [dstFileEntry.file_.storagePath, srcFileEntry.file_.blob_, 0]);
 
                     }, errorCallback, [parentFullPath, name, {create: true}]);
 
-                }, function() { if (errorCallback) { errorCallback(FileError.NOT_FOUND_ERR); }},
-                [path.storagePath, null, {create:false}]);
+                }, function () { if (errorCallback) { errorCallback(FileError.NOT_FOUND_ERR); } },
+                [path.storagePath, null, {create: false}]);
 
             }, errorCallback, [srcPath, null]);
         };
 
-        exports.moveTo = function(successCallback, errorCallback, args) {
+        exports.moveTo = function (successCallback, errorCallback, args) {
             var srcPath = args[0];
             // parentFullPath and name parameters is ignored because
             // args is being passed downstream to exports.copyTo method
-            var parentFullPath = args[1]; // jshint ignore: line
-            var name = args[2]; // jshint ignore: line
+            var parentFullPath = args[1]; // eslint-disable-line
+            var name = args[2]; // eslint-disable-line
 
             exports.copyTo(function (fileEntry) {
 
@@ -510,16 +510,16 @@
             }, errorCallback, args);
         };
 
-        exports.resolveLocalFileSystemURI = function(successCallback, errorCallback, args) {
+        exports.resolveLocalFileSystemURI = function (successCallback, errorCallback, args) {
             var path = args[0];
 
             // Ignore parameters
             if (path.indexOf('?') !== -1) {
-                path = String(path).split("?")[0];
+                path = String(path).split('?')[0];
             }
 
             // support for encodeURI
-            if (/\%5/g.test(path) || /\%20/g.test(path)) {
+            if (/\%5/g.test(path) || /\%20/g.test(path)) {  // eslint-disable-line no-useless-escape
                 path = decodeURI(path);
             }
 
@@ -530,23 +530,23 @@
                 return;
             }
 
-            //support for cdvfile
-            if (path.trim().substr(0,7) === "cdvfile") {
-                if (path.indexOf("cdvfile://localhost") === -1) {
+            // support for cdvfile
+            if (path.trim().substr(0, 7) === 'cdvfile') {
+                if (path.indexOf('cdvfile://localhost') === -1) {
                     if (errorCallback) {
                         errorCallback(FileError.ENCODING_ERR);
                     }
                     return;
                 }
 
-                var indexPersistent = path.indexOf("persistent");
-                var indexTemporary = path.indexOf("temporary");
+                var indexPersistent = path.indexOf('persistent');
+                var indexTemporary = path.indexOf('temporary');
 
-                //cdvfile://localhost/persistent/path/to/file
+                // cdvfile://localhost/persistent/path/to/file
                 if (indexPersistent !== -1) {
-                    path =  "file:///persistent" + path.substr(indexPersistent + 10);
+                    path = 'file:///persistent' + path.substr(indexPersistent + 10);
                 } else if (indexTemporary !== -1) {
-                    path = "file:///temporary" + path.substr(indexTemporary + 9);
+                    path = 'file:///temporary' + path.substr(indexTemporary + 9);
                 } else {
                     if (errorCallback) {
                         errorCallback(FileError.ENCODING_ERR);
@@ -556,8 +556,8 @@
             }
 
             // to avoid path form of '///path/to/file'
-            function handlePathSlashes(path) {
-                var cutIndex  = 0;
+            function handlePathSlashes (path) {
+                var cutIndex = 0;
                 for (var i = 0; i < path.length - 1; i++) {
                     if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {
                         cutIndex = i + 1;
@@ -576,8 +576,8 @@
                 path = path.substring(pathsPrefix.dataDirectory.length - 1);
                 path = handlePathSlashes(path);
 
-                exports.requestFileSystem(function() {
-                    exports.getFile(successCallback, function() {
+                exports.requestFileSystem(function () {
+                    exports.getFile(successCallback, function () {
                         exports.getDirectory(successCallback, errorCallback, [pathsPrefix.dataDirectory, path,
                         {create: false}]);
                     }, [pathsPrefix.dataDirectory, path, {create: false}]);
@@ -586,47 +586,47 @@
                 path = path.substring(pathsPrefix.cacheDirectory.length - 1);
                 path = handlePathSlashes(path);
 
-                exports.requestFileSystem(function() {
-                    exports.getFile(successCallback, function() {
+                exports.requestFileSystem(function () {
+                    exports.getFile(successCallback, function () {
                         exports.getDirectory(successCallback, errorCallback, [pathsPrefix.cacheDirectory, path,
                         {create: false}]);
                     }, [pathsPrefix.cacheDirectory, path, {create: false}]);
                 }, errorCallback, [LocalFileSystem.TEMPORARY]);
             } else if (path.indexOf(pathsPrefix.applicationDirectory) === 0) {
                 path = path.substring(pathsPrefix.applicationDirectory.length);
-                //TODO: need to cut out redundant slashes?
+                // TODO: need to cut out redundant slashes?
 
-                var xhr = new XMLHttpRequest();
-                xhr.open("GET", path, true);
+                var xhr = new XMLHttpRequest(); // eslint-disable-line no-undef
+                xhr.open('GET', path, true);
                 xhr.onreadystatechange = function () {
                     if (xhr.status === 200 && xhr.readyState === 4) {
-                        exports.requestFileSystem(function(fs) {
-                            fs.name = location.hostname;
+                        exports.requestFileSystem(function (fs) {
+                            fs.name = location.hostname; // eslint-disable-line no-undef
 
-                            //TODO: need to call exports.getFile(...) to handle errors correct
+                            // TODO: need to call exports.getFile(...) to handle errors correct
                             fs.root.getFile(path, {create: true}, writeFile, errorCallback);
                         }, errorCallback, [LocalFileSystem.PERSISTENT]);
                     }
                 };
 
                 xhr.onerror = function () {
-                    if(errorCallback) {
+                    if (errorCallback) {
                         errorCallback(FileError.NOT_READABLE_ERR);
                     }
                 };
 
                 xhr.send();
             } else {
-                if(errorCallback) {
+                if (errorCallback) {
                     errorCallback(FileError.NOT_FOUND_ERR);
                 }
             }
 
-            function writeFile(entry) {
+            function writeFile (entry) {
                 entry.createWriter(function (fileWriter) {
                     fileWriter.onwriteend = function (evt) {
                         if (!evt.target.error) {
-                            entry.filesystemName = location.hostname;
+                            entry.filesystemName = location.hostname; // eslint-disable-line no-undef
                             successCallback(entry);
                         }
                     };
@@ -635,16 +635,16 @@
                             errorCallback(FileError.NOT_READABLE_ERR);
                         }
                     };
-                    fileWriter.write(new Blob([xhr.response]));
-                }, errorCallback);
+                    fileWriter.write(new Blob([xhr.response])); // eslint-disable-line no-undef
+                }, errorCallback); // eslint-disable-line no-undef
             }
         };
 
-        exports.requestAllPaths = function(successCallback) {
+        exports.requestAllPaths = function (successCallback) {
             successCallback(pathsPrefix);
         };
 
-    /*** Helpers ***/
+    /** * Helpers ***/
 
         /**
          * Interface to wrap the native File interface.
@@ -657,8 +657,8 @@
          * @param {Object} opts Initial values.
          * @constructor
          */
-        function MyFile(opts) {
-            var blob_ = new Blob();
+        function MyFile (opts) {
+            var blob_ = new Blob(); // eslint-disable-line no-undef
 
             this.size = opts.size || 0;
             this.name = opts.name || '';
@@ -670,10 +670,10 @@
             // blob that is saved.
             Object.defineProperty(this, 'blob_', {
                 enumerable: true,
-                get: function() {
+                get: function () {
                     return blob_;
                 },
-                set: function(val) {
+                set: function (val) {
                     blob_ = val;
                     this.size = blob_.size;
                     this.name = blob_.name;
@@ -688,7 +688,7 @@
         // When saving an entry, the fullPath should always lead with a slash and never
         // end with one (e.g. a directory). Also, resolve '.' and '..' to an absolute
         // one. This method ensures path is legit!
-        function resolveToFullPath_(cwdFullPath, path) {
+        function resolveToFullPath_ (cwdFullPath, path) {
             path = path || '';
             var fullPath = path;
             var prefix = '';
@@ -722,7 +722,7 @@
                     parts[i] = '';
                 }
             }
-            fullPath = parts.filter(function(el) {
+            fullPath = parts.filter(function (el) {
                 return el;
             }).join(DIR_SEPARATOR);
 
@@ -758,7 +758,7 @@
             };
         }
 
-        function fileEntryFromIdbEntry(fileEntry) {
+        function fileEntryFromIdbEntry (fileEntry) {
             // IDB won't save methods, so we need re-create the FileEntry.
             var clonedFileEntry = new FileEntry(fileEntry.name, fileEntry.fullPath, fileEntry.filesystem);
             clonedFileEntry.file_ = fileEntry.file_;
@@ -766,46 +766,46 @@
             return clonedFileEntry;
         }
 
-        function readAs(what, fullPath, encoding, startPos, endPos, successCallback, errorCallback) {
-            exports.getFile(function(fileEntry) {
-                var fileReader = new FileReader(),
-                    blob = fileEntry.file_.blob_.slice(startPos, endPos);
+        function readAs (what, fullPath, encoding, startPos, endPos, successCallback, errorCallback) {
+            exports.getFile(function (fileEntry) {
+                var fileReader = new FileReader(); // eslint-disable-line no-undef
+                var blob = fileEntry.file_.blob_.slice(startPos, endPos);
 
-                fileReader.onload = function(e) {
+                fileReader.onload = function (e) {
                     successCallback(e.target.result);
                 };
 
                 fileReader.onerror = errorCallback;
 
                 switch (what) {
-                    case 'text':
-                        fileReader.readAsText(blob, encoding);
-                        break;
-                    case 'dataURL':
-                        fileReader.readAsDataURL(blob);
-                        break;
-                    case 'arrayBuffer':
-                        fileReader.readAsArrayBuffer(blob);
-                        break;
-                    case 'binaryString':
-                        fileReader.readAsBinaryString(blob);
-                        break;
+                case 'text':
+                    fileReader.readAsText(blob, encoding);
+                    break;
+                case 'dataURL':
+                    fileReader.readAsDataURL(blob);
+                    break;
+                case 'arrayBuffer':
+                    fileReader.readAsArrayBuffer(blob);
+                    break;
+                case 'binaryString':
+                    fileReader.readAsBinaryString(blob);
+                    break;
                 }
 
             }, errorCallback, [fullPath, null]);
         }
 
-    /*** Core logic to handle IDB operations ***/
+    /** * Core logic to handle IDB operations ***/
 
-        idb_.open = function(dbName, successCallback, errorCallback) {
+        idb_.open = function (dbName, successCallback, errorCallback) {
             var self = this;
 
             // TODO: FF 12.0a1 isn't liking a db name with : in it.
-            var request = indexedDB.open(dbName.replace(':', '_')/*, 1 /*version*/);
+            var request = indexedDB.open(dbName.replace(':', '_')/*, 1 /*version */);
 
             request.onerror = errorCallback || onError;
 
-            request.onupgradeneeded = function(e) {
+            request.onupgradeneeded = function (e) {
                 // First open was called or higher db version was used.
 
                 // console.log('onupgradeneeded: oldVersion:' + e.oldVersion,
@@ -815,11 +815,11 @@
                 self.db.onerror = onError;
 
                 if (!self.db.objectStoreNames.contains(FILE_STORE_)) {
-                    self.db.createObjectStore(FILE_STORE_/*,{keyPath: 'id', autoIncrement: true}*/);
+                    self.db.createObjectStore(FILE_STORE_/*, {keyPath: 'id', autoIncrement: true} */);
                 }
             };
 
-            request.onsuccess = function(e) {
+            request.onsuccess = function (e) {
                 self.db = e.target.result;
                 self.db.onerror = onError;
                 successCallback(e);
@@ -828,12 +828,12 @@
             request.onblocked = errorCallback || onError;
         };
 
-        idb_.close = function() {
+        idb_.close = function () {
             this.db.close();
             this.db = null;
         };
 
-        idb_.get = function(fullPath, successCallback, errorCallback) {
+        idb_.get = function (fullPath, successCallback, errorCallback) {
             if (!this.db) {
                 if (errorCallback) {
                     errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -846,12 +846,12 @@
             var request = tx.objectStore(FILE_STORE_).get(fullPath);
 
             tx.onabort = errorCallback || onError;
-            tx.oncomplete = function() {
+            tx.oncomplete = function () {
                 successCallback(request.result);
             };
         };
 
-        idb_.getAllEntries = function(fullPath, storagePath, successCallback, errorCallback) {
+        idb_.getAllEntries = function (fullPath, storagePath, successCallback, errorCallback) {
             if (!this.db) {
                 if (errorCallback) {
                     errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -870,8 +870,8 @@
 
             var tx = this.db.transaction([FILE_STORE_], 'readonly');
             tx.onabort = errorCallback || onError;
-            tx.oncomplete = function() {
-                results = results.filter(function(val) {
+            tx.oncomplete = function () {
+                results = results.filter(function (val) {
                     var pathWithoutSlash = val.fullPath;
 
                     if (val.fullPath[val.fullPath.length - 1] === DIR_SEPARATOR) {
@@ -883,9 +883,9 @@
 
                     /* Input fullPath parameter  equals '//' for root folder */
                     /* Entries in root folder has valPartsLen equals 2 (see below) */
-                    if (fullPath[fullPath.length -1] === DIR_SEPARATOR && fullPath.trim().length === 2) {
+                    if (fullPath[fullPath.length - 1] === DIR_SEPARATOR && fullPath.trim().length === 2) {
                         fullPathPartsLen = 1;
-                    } else if (fullPath[fullPath.length -1] === DIR_SEPARATOR) {
+                    } else if (fullPath[fullPath.length - 1] === DIR_SEPARATOR) {
                         fullPathPartsLen = fullPath.substr(0, fullPath.length - 1).split(DIR_SEPARATOR).length;
                     } else {
                         fullPathPartsLen = fullPath.split(DIR_SEPARATOR).length;
@@ -903,7 +903,7 @@
 
             var request = tx.objectStore(FILE_STORE_).openCursor(range);
 
-            request.onsuccess = function(e) {
+            request.onsuccess = function (e) {
                 var cursor = e.target.result;
                 if (cursor) {
                     var val = cursor.value;
@@ -914,7 +914,7 @@
             };
         };
 
-        idb_['delete'] = function(fullPath, successCallback, errorCallback, isDirectory) {
+        idb_['delete'] = function (fullPath, successCallback, errorCallback, isDirectory) {
             if (!idb_.db) {
                 if (errorCallback) {
                     errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -925,14 +925,14 @@
             var tx = this.db.transaction([FILE_STORE_], 'readwrite');
             tx.oncomplete = successCallback;
             tx.onabort = errorCallback || onError;
-            tx.oncomplete = function() {
+            tx.oncomplete = function () {
                 if (isDirectory) {
-                    //We delete nested files and folders after deleting parent folder
-                    //We use ranges: https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange
+                    // We delete nested files and folders after deleting parent folder
+                    // We use ranges: https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange
                     fullPath = fullPath + DIR_SEPARATOR;
 
-                    //Range contains all entries in the form fullPath<symbol> where
-                    //symbol in the range from ' ' to symbol which has code `unicodeLastChar`
+                    // Range contains all entries in the form fullPath<symbol> where
+                    // symbol in the range from ' ' to symbol which has code `unicodeLastChar`
                     var range = IDBKeyRange.bound(fullPath + ' ', fullPath + String.fromCharCode(unicodeLastChar));
 
                     var newTx = this.db.transaction([FILE_STORE_], 'readwrite');
@@ -946,7 +946,7 @@
             tx.objectStore(FILE_STORE_)['delete'](fullPath);
         };
 
-        idb_.put = function(entry, storagePath, successCallback, errorCallback) {
+        idb_.put = function (entry, storagePath, successCallback, errorCallback) {
             if (!this.db) {
                 if (errorCallback) {
                     errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -956,7 +956,7 @@
 
             var tx = this.db.transaction([FILE_STORE_], 'readwrite');
             tx.onabort = errorCallback || onError;
-            tx.oncomplete = function() {
+            tx.oncomplete = function () {
                 // TODO: Error is thrown if we pass the request event back instead.
                 successCallback(entry);
             };
@@ -965,14 +965,14 @@
         };
 
         // Global error handler. Errors bubble from request, to transaction, to db.
-        function onError(e) {
+        function onError (e) {
             switch (e.target.errorCode) {
-                case 12:
-                    console.log('Error - Attempt to open db with a lower version than the ' +
+            case 12:
+                console.log('Error - Attempt to open db with a lower version than the ' +
                         'current one.');
-                    break;
-                default:
-                    console.log('errorCode: ' + e.target.errorCode);
+                break;
+            default:
+                console.log('errorCode: ' + e.target.errorCode);
             }
 
             console.log(e, e.code, e.message);
@@ -980,5 +980,5 @@
 
     })(module.exports, window);
 
-    require("cordova/exec/proxy").add("File", module.exports);
+    require('cordova/exec/proxy').add('File', module.exports);
 })();

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/src/firefoxos/FileProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/FileProxy.js b/src/firefoxos/FileProxy.js
index 946304b..8ae181d 100644
--- a/src/firefoxos/FileProxy.js
+++ b/src/firefoxos/FileProxy.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,12 +21,12 @@
 
 /* global IDBKeyRange */
 
-var LocalFileSystem = require('./LocalFileSystem'),
-    FileSystem = require('./FileSystem'),
-    FileEntry = require('./FileEntry'),
-    FileError = require('./FileError'),
-    DirectoryEntry = require('./DirectoryEntry'),
-    File = require('./File');
+var LocalFileSystem = require('./LocalFileSystem');
+var FileSystem = require('./FileSystem');
+var FileEntry = require('./FileEntry');
+var FileError = require('./FileError');
+var DirectoryEntry = require('./DirectoryEntry'); // eslint-disable-line no-undef
+var File = require('./File');
 
 /*
 QUIRKS:
@@ -39,11 +39,10 @@ QUIRKS:
     Heavily based on https://github.com/ebidel/idb.filesystem.js
  */
 
-
-(function(exports, global) {
+(function (exports, global) {
     var indexedDB = global.indexedDB || global.mozIndexedDB;
     if (!indexedDB) {
-        throw "Firefox OS File plugin: indexedDB not supported";
+        throw 'Firefox OS File plugin: indexedDB not supported';
     }
 
     var fs_ = null;
@@ -57,19 +56,19 @@ QUIRKS:
 
     var pathsPrefix = {
         // Read-only directory where the application is installed.
-        applicationDirectory: location.origin + "/",
+        applicationDirectory: location.origin + '/', // eslint-disable-line no-undef
         // Where to put app-specific data files.
         dataDirectory: 'file:///persistent/',
         // Cached files that should survive app restarts.
         // Apps should not rely on the OS to delete files in here.
-        cacheDirectory: 'file:///temporary/',
+        cacheDirectory: 'file:///temporary/'
     };
 
-/*** Exported functionality ***/
+/** * Exported functionality ***/
 
-    exports.requestFileSystem = function(successCallback, errorCallback, args) {
+    exports.requestFileSystem = function (successCallback, errorCallback, args) {
         var type = args[0];
-        //var size = args[1];
+        // var size = args[1];
 
         if (type !== LocalFileSystem.TEMPORARY && type !== LocalFileSystem.PERSISTENT) {
             if (errorCallback) {
@@ -79,22 +78,22 @@ QUIRKS:
         }
 
         var name = type === LocalFileSystem.TEMPORARY ? 'temporary' : 'persistent';
-        var storageName = (location.protocol + location.host).replace(/:/g, '_');
+        var storageName = (location.protocol + location.host).replace(/:/g, '_'); // eslint-disable-line no-undef
 
         var root = new DirectoryEntry('', DIR_SEPARATOR);
         fs_ = new FileSystem(name, root);
 
-        idb_.open(storageName, function() {
+        idb_.open(storageName, function () {
             successCallback(fs_);
         }, errorCallback);
     };
 
-    require('./fileSystems').getFs = function(name, callback) {
+    require('./fileSystems').getFs = function (name, callback) {
         callback(new FileSystem(name, fs_.root));
     };
 
     // list a directory's contents (files and folders).
-    exports.readEntries = function(successCallback, errorCallback, args) {
+    exports.readEntries = function (successCallback, errorCallback, args) {
         var fullPath = args[0];
 
         if (!successCallback) {
@@ -103,12 +102,12 @@ QUIRKS:
 
         var path = resolveToFullPath_(fullPath);
 
-        idb_.getAllEntries(path.fullPath, path.storagePath, function(entries) {
+        idb_.getAllEntries(path.fullPath, path.storagePath, function (entries) {
             successCallback(entries);
         }, errorCallback);
     };
 
-    exports.getFile = function(successCallback, errorCallback, args) {
+    exports.getFile = function (successCallback, errorCallback, args) {
         var fullPath = args[0];
         var path = args[1];
         var options = args[2] || {};
@@ -116,7 +115,7 @@ QUIRKS:
         // Create an absolute path if we were handed a relative one.
         path = resolveToFullPath_(fullPath, path);
 
-        idb_.get(path.storagePath, function(fileEntry) {
+        idb_.get(path.storagePath, function (fileEntry) {
             if (options.create === true && options.exclusive === true && fileEntry) {
                 // If create and exclusive are both true, and the path already exists,
                 // getFile must fail.
@@ -141,7 +140,7 @@ QUIRKS:
             } else if (options.create === true && fileEntry) {
                 if (fileEntry.isFile) {
                     // Overwrite file, delete then create new.
-                    idb_['delete'](path.storagePath, function() {
+                    idb_['delete'](path.storagePath, function () {
                         var newFileEntry = new FileEntry(path.fileName, path.fullPath, new FileSystem(path.fsName, fs_.root));
 
                         newFileEntry.file_ = new MyFile({
@@ -179,16 +178,16 @@ QUIRKS:
         }, errorCallback);
     };
 
-    exports.getFileMetadata = function(successCallback, errorCallback, args) {
+    exports.getFileMetadata = function (successCallback, errorCallback, args) {
         var fullPath = args[0];
 
-        exports.getFile(function(fileEntry) {
+        exports.getFile(function (fileEntry) {
             successCallback(new File(fileEntry.file_.name, fileEntry.fullPath, '', fileEntry.file_.lastModifiedDate,
                 fileEntry.file_.size));
         }, errorCallback, [fullPath, null]);
     };
 
-    exports.getMetadata = function(successCallback, errorCallback, args) {
+    exports.getMetadata = function (successCallback, errorCallback, args) {
         exports.getFile(function (fileEntry) {
             successCallback(
                 {
@@ -198,20 +197,20 @@ QUIRKS:
         }, errorCallback, args);
     };
 
-    exports.setMetadata = function(successCallback, errorCallback, args) {
+    exports.setMetadata = function (successCallback, errorCallback, args) {
         var fullPath = args[0];
         var metadataObject = args[1];
 
         exports.getFile(function (fileEntry) {
-              fileEntry.file_.lastModifiedDate = metadataObject.modificationTime;
+            fileEntry.file_.lastModifiedDate = metadataObject.modificationTime;
         }, errorCallback, [fullPath, null]);
     };
 
-    exports.write = function(successCallback, errorCallback, args) {
-        var fileName = args[0],
-            data = args[1],
-            position = args[2];
-            //isBinary = args[3];
+    exports.write = function (successCallback, errorCallback, args) {
+        var fileName = args[0];
+        var data = args[1];
+        var position = args[2];
+            // isBinary = args[3];
 
         if (!data) {
             if (errorCallback) {
@@ -220,11 +219,11 @@ QUIRKS:
             return;
         }
 
-        exports.getFile(function(fileEntry) {
+        exports.getFile(function (fileEntry) {
             var blob_ = fileEntry.file_.blob_;
 
             if (!blob_) {
-                blob_ = new Blob([data], {type: data.type});
+                blob_ = new Blob([data], {type: data.type}); // eslint-disable-line no-undef
             } else {
                 // Calc the head and tail fragments
                 var head = blob_.slice(0, position);
@@ -237,7 +236,7 @@ QUIRKS:
                 }
 
                 // Do the "write". In fact, a full overwrite of the Blob.
-                blob_ = new Blob([head, new Uint8Array(padding), data, tail],
+                blob_ = new Blob([head, new Uint8Array(padding), data, tail], // eslint-disable-line no-undef
                     {type: data.type});
             }
 
@@ -248,56 +247,56 @@ QUIRKS:
             fileEntry.file_.name = blob_.name;
             fileEntry.file_.type = blob_.type;
 
-            idb_.put(fileEntry, fileEntry.file_.storagePath, function() {
+            idb_.put(fileEntry, fileEntry.file_.storagePath, function () {
                 successCallback(data.byteLength);
             }, errorCallback);
         }, errorCallback, [fileName, null]);
     };
 
-    exports.readAsText = function(successCallback, errorCallback, args) {
-        var fileName = args[0],
-            enc = args[1],
-            startPos = args[2],
-            endPos = args[3];
+    exports.readAsText = function (successCallback, errorCallback, args) {
+        var fileName = args[0];
+        var enc = args[1];
+        var startPos = args[2];
+        var endPos = args[3];
 
         readAs('text', fileName, enc, startPos, endPos, successCallback, errorCallback);
     };
 
-    exports.readAsDataURL = function(successCallback, errorCallback, args) {
-        var fileName = args[0],
-            startPos = args[1],
-            endPos = args[2];
+    exports.readAsDataURL = function (successCallback, errorCallback, args) {
+        var fileName = args[0];
+        var startPos = args[1];
+        var endPos = args[2];
 
         readAs('dataURL', fileName, null, startPos, endPos, successCallback, errorCallback);
     };
 
-    exports.readAsBinaryString = function(successCallback, errorCallback, args) {
-        var fileName = args[0],
-            startPos = args[1],
-            endPos = args[2];
+    exports.readAsBinaryString = function (successCallback, errorCallback, args) {
+        var fileName = args[0];
+        var startPos = args[1];
+        var endPos = args[2];
 
         readAs('binaryString', fileName, null, startPos, endPos, successCallback, errorCallback);
     };
 
-    exports.readAsArrayBuffer = function(successCallback, errorCallback, args) {
-        var fileName = args[0],
-            startPos = args[1],
-            endPos = args[2];
+    exports.readAsArrayBuffer = function (successCallback, errorCallback, args) {
+        var fileName = args[0];
+        var startPos = args[1];
+        var endPos = args[2];
 
         readAs('arrayBuffer', fileName, null, startPos, endPos, successCallback, errorCallback);
     };
 
-    exports.removeRecursively = exports.remove = function(successCallback, errorCallback, args) {
+    exports.removeRecursively = exports.remove = function (successCallback, errorCallback, args) {
         var fullPath = args[0];
 
         // TODO: This doesn't protect against directories that have content in it.
         // Should throw an error instead if the dirEntry is not empty.
-        idb_['delete'](fullPath, function() {
+        idb_['delete'](fullPath, function () {
             successCallback();
         }, errorCallback);
     };
 
-    exports.getDirectory = function(successCallback, errorCallback, args) {
+    exports.getDirectory = function (successCallback, errorCallback, args) {
         var fullPath = args[0];
         var path = args[1];
         var options = args[2];
@@ -305,7 +304,7 @@ QUIRKS:
         // Create an absolute path if we were handed a relative one.
         path = resolveToFullPath_(fullPath, path);
 
-        idb_.get(path.storagePath, function(folderEntry) {
+        idb_.get(path.storagePath, function (folderEntry) {
             if (!options) {
                 options = {};
             }
@@ -361,7 +360,7 @@ QUIRKS:
         }, errorCallback);
     };
 
-    exports.getParent = function(successCallback, errorCallback, args) {
+    exports.getParent = function (successCallback, errorCallback, args) {
         var fullPath = args[0];
 
         if (fullPath === DIR_SEPARATOR) {
@@ -377,18 +376,18 @@ QUIRKS:
         exports.getDirectory(successCallback, errorCallback, [path, namesa, {create: false}]);
     };
 
-    exports.copyTo = function(successCallback, errorCallback, args) {
+    exports.copyTo = function (successCallback, errorCallback, args) {
         var srcPath = args[0];
         var parentFullPath = args[1];
         var name = args[2];
 
         // Read src file
-        exports.getFile(function(srcFileEntry) {
+        exports.getFile(function (srcFileEntry) {
 
             // Create dest file
-            exports.getFile(function(dstFileEntry) {
+            exports.getFile(function (dstFileEntry) {
 
-                exports.write(function() {
+                exports.write(function () {
                     successCallback(dstFileEntry);
                 }, errorCallback, [dstFileEntry.file_.storagePath, srcFileEntry.file_.blob_, 0]);
 
@@ -397,10 +396,10 @@ QUIRKS:
         }, errorCallback, [srcPath, null]);
     };
 
-    exports.moveTo = function(successCallback, errorCallback, args) {
+    exports.moveTo = function (successCallback, errorCallback, args) {
         var srcPath = args[0];
-        //var parentFullPath = args[1];
-        //var name = args[2];
+        // var parentFullPath = args[1];
+        // var name = args[2];
 
         exports.copyTo(function (fileEntry) {
 
@@ -411,44 +410,44 @@ QUIRKS:
         }, errorCallback, args);
     };
 
-    exports.resolveLocalFileSystemURI = function(successCallback, errorCallback, args) {
+    exports.resolveLocalFileSystemURI = function (successCallback, errorCallback, args) {
         var path = args[0];
 
         // Ignore parameters
         if (path.indexOf('?') !== -1) {
-            path = String(path).split("?")[0];
+            path = String(path).split('?')[0];
         }
 
         // support for encodeURI
-        if (/\%5/g.test(path)) {
+        if (/\%5/g.test(path)) { // eslint-disable-line no-useless-escape
             path = decodeURI(path);
         }
 
         if (path.indexOf(pathsPrefix.dataDirectory) === 0) {
             path = path.substring(pathsPrefix.dataDirectory.length - 1);
 
-            exports.requestFileSystem(function(fs) {
-                fs.root.getFile(path, {create: false}, successCallback, function() {
+            exports.requestFileSystem(function (fs) {
+                fs.root.getFile(path, {create: false}, successCallback, function () {
                     fs.root.getDirectory(path, {create: false}, successCallback, errorCallback);
                 });
             }, errorCallback, [LocalFileSystem.PERSISTENT]);
         } else if (path.indexOf(pathsPrefix.cacheDirectory) === 0) {
             path = path.substring(pathsPrefix.cacheDirectory.length - 1);
 
-            exports.requestFileSystem(function(fs) {
-                fs.root.getFile(path, {create: false}, successCallback, function() {
+            exports.requestFileSystem(function (fs) {
+                fs.root.getFile(path, {create: false}, successCallback, function () {
                     fs.root.getDirectory(path, {create: false}, successCallback, errorCallback);
                 });
             }, errorCallback, [LocalFileSystem.TEMPORARY]);
         } else if (path.indexOf(pathsPrefix.applicationDirectory) === 0) {
             path = path.substring(pathsPrefix.applicationDirectory.length);
 
-            var xhr = new XMLHttpRequest();
-            xhr.open("GET", path, true);
+            var xhr = new XMLHttpRequest(); // eslint-disable-line no-undef
+            xhr.open('GET', path, true);
             xhr.onreadystatechange = function () {
                 if (xhr.status === 200 && xhr.readyState === 4) {
-                    exports.requestFileSystem(function(fs) {
-                        fs.name = location.hostname;
+                    exports.requestFileSystem(function (fs) {
+                        fs.name = location.hostname; // eslint-disable-line no-undef
                         fs.root.getFile(path, {create: true}, writeFile, errorCallback);
                     }, errorCallback, [LocalFileSystem.PERSISTENT]);
                 }
@@ -467,11 +466,11 @@ QUIRKS:
             }
         }
 
-        function writeFile(entry) {
+        function writeFile (entry) {
             entry.createWriter(function (fileWriter) {
                 fileWriter.onwriteend = function (evt) {
                     if (!evt.target.error) {
-                        entry.filesystemName = location.hostname;
+                        entry.filesystemName = location.hostname; // eslint-disable-line no-undef
                         successCallback(entry);
                     }
                 };
@@ -480,16 +479,16 @@ QUIRKS:
                         errorCallback(FileError.NOT_READABLE_ERR);
                     }
                 };
-                fileWriter.write(new Blob([xhr.response]));
+                fileWriter.write(new Blob([xhr.response])); // eslint-disable-line no-undef
             }, errorCallback);
         }
     };
 
-    exports.requestAllPaths = function(successCallback) {
+    exports.requestAllPaths = function (successCallback) {
         successCallback(pathsPrefix);
     };
 
-/*** Helpers ***/
+/** * Helpers ***/
 
     /**
      * Interface to wrap the native File interface.
@@ -502,8 +501,8 @@ QUIRKS:
      * @param {Object} opts Initial values.
      * @constructor
      */
-    function MyFile(opts) {
-        var blob_ = new Blob();
+    function MyFile (opts) {
+        var blob_ = new Blob(); // eslint-disable-line no-undef
 
         this.size = opts.size || 0;
         this.name = opts.name || '';
@@ -515,10 +514,10 @@ QUIRKS:
         // blob that is saved.
         Object.defineProperty(this, 'blob_', {
             enumerable: true,
-            get: function() {
+            get: function () {
                 return blob_;
             },
-            set: function(val) {
+            set: function (val) {
                 blob_ = val;
                 this.size = blob_.size;
                 this.name = blob_.name;
@@ -533,21 +532,22 @@ QUIRKS:
     // When saving an entry, the fullPath should always lead with a slash and never
     // end with one (e.g. a directory). Also, resolve '.' and '..' to an absolute
     // one. This method ensures path is legit!
-    function resolveToFullPath_(cwdFullPath, path) {
+    function resolveToFullPath_ (cwdFullPath, path) {
         path = path || '';
         var fullPath = path;
         var prefix = '';
 
         cwdFullPath = cwdFullPath || DIR_SEPARATOR;
+        /* eslint-disable no-undef */
         if (cwdFullPath.indexOf(FILESYSTEM_PREFIX) === 0) {
             prefix = cwdFullPath.substring(0, cwdFullPath.indexOf(DIR_SEPARATOR, FILESYSTEM_PREFIX.length));
             cwdFullPath = cwdFullPath.substring(cwdFullPath.indexOf(DIR_SEPARATOR, FILESYSTEM_PREFIX.length));
         }
-
+        /* eslint-enable no-undef */
         var relativePath = path[0] !== DIR_SEPARATOR;
         if (relativePath) {
             fullPath = cwdFullPath;
-            if (cwdFullPath != DIR_SEPARATOR) {
+            if (cwdFullPath !== DIR_SEPARATOR) {
                 fullPath += DIR_SEPARATOR + path;
             } else {
                 fullPath += path;
@@ -558,12 +558,12 @@ QUIRKS:
         var parts = fullPath.split(DIR_SEPARATOR);
         for (var i = 0; i < parts.length; ++i) {
             var part = parts[i];
-            if (part == '..') {
+            if (part === '..') {
                 parts[i - 1] = '';
                 parts[i] = '';
             }
         }
-        fullPath = parts.filter(function(el) {
+        fullPath = parts.filter(function (el) {
             return el;
         }).join(DIR_SEPARATOR);
 
@@ -582,8 +582,8 @@ QUIRKS:
         fullPath = fullPath.replace(/\/\./g, DIR_SEPARATOR);
 
         // Remove '/' if it appears on the end.
-        if (fullPath[fullPath.length - 1] == DIR_SEPARATOR &&
-            fullPath != DIR_SEPARATOR) {
+        if (fullPath[fullPath.length - 1] === DIR_SEPARATOR &&
+            fullPath !== DIR_SEPARATOR) {
             fullPath = fullPath.substring(0, fullPath.length - 1);
         }
 
@@ -595,7 +595,7 @@ QUIRKS:
         };
     }
 
-    function fileEntryFromIdbEntry(fileEntry) {
+    function fileEntryFromIdbEntry (fileEntry) {
         // IDB won't save methods, so we need re-create the FileEntry.
         var clonedFileEntry = new FileEntry(fileEntry.name, fileEntry.fullPath, fileEntry.fileSystem);
         clonedFileEntry.file_ = fileEntry.file_;
@@ -603,46 +603,46 @@ QUIRKS:
         return clonedFileEntry;
     }
 
-    function readAs(what, fullPath, encoding, startPos, endPos, successCallback, errorCallback) {
-        exports.getFile(function(fileEntry) {
-            var fileReader = new FileReader(),
-                blob = fileEntry.file_.blob_.slice(startPos, endPos);
+    function readAs (what, fullPath, encoding, startPos, endPos, successCallback, errorCallback) {
+        exports.getFile(function (fileEntry) {
+            var fileReader = new FileReader(); // eslint-disable-line no-undef
+            var blob = fileEntry.file_.blob_.slice(startPos, endPos);
 
-            fileReader.onload = function(e) {
+            fileReader.onload = function (e) {
                 successCallback(e.target.result);
             };
 
             fileReader.onerror = errorCallback;
 
             switch (what) {
-                case 'text':
-                    fileReader.readAsText(blob, encoding);
-                    break;
-                case 'dataURL':
-                    fileReader.readAsDataURL(blob);
-                    break;
-                case 'arrayBuffer':
-                    fileReader.readAsArrayBuffer(blob);
-                    break;
-                case 'binaryString':
-                    fileReader.readAsBinaryString(blob);
-                    break;
+            case 'text':
+                fileReader.readAsText(blob, encoding);
+                break;
+            case 'dataURL':
+                fileReader.readAsDataURL(blob);
+                break;
+            case 'arrayBuffer':
+                fileReader.readAsArrayBuffer(blob);
+                break;
+            case 'binaryString':
+                fileReader.readAsBinaryString(blob);
+                break;
             }
 
         }, errorCallback, [fullPath, null]);
     }
 
-/*** Core logic to handle IDB operations ***/
+/** * Core logic to handle IDB operations ***/
 
-    idb_.open = function(dbName, successCallback, errorCallback) {
+    idb_.open = function (dbName, successCallback, errorCallback) {
         var self = this;
 
         // TODO: FF 12.0a1 isn't liking a db name with : in it.
-        var request = indexedDB.open(dbName.replace(':', '_')/*, 1 /*version*/);
+        var request = indexedDB.open(dbName.replace(':', '_')/*, 1 /*version */);
 
         request.onerror = errorCallback || onError;
 
-        request.onupgradeneeded = function(e) {
+        request.onupgradeneeded = function (e) {
             // First open was called or higher db version was used.
 
             // console.log('onupgradeneeded: oldVersion:' + e.oldVersion,
@@ -652,11 +652,11 @@ QUIRKS:
             self.db.onerror = onError;
 
             if (!self.db.objectStoreNames.contains(FILE_STORE_)) {
-                self.db.createObjectStore(FILE_STORE_/*,{keyPath: 'id', autoIncrement: true}*/);
+                self.db.createObjectStore(FILE_STORE_/*, {keyPath: 'id', autoIncrement: true} */);
             }
         };
 
-        request.onsuccess = function(e) {
+        request.onsuccess = function (e) {
             self.db = e.target.result;
             self.db.onerror = onError;
             successCallback(e);
@@ -665,12 +665,12 @@ QUIRKS:
         request.onblocked = errorCallback || onError;
     };
 
-    idb_.close = function() {
+    idb_.close = function () {
         this.db.close();
         this.db = null;
     };
 
-    idb_.get = function(fullPath, successCallback, errorCallback) {
+    idb_.get = function (fullPath, successCallback, errorCallback) {
         if (!this.db) {
             if (errorCallback) {
                 errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -680,18 +680,18 @@ QUIRKS:
 
         var tx = this.db.transaction([FILE_STORE_], 'readonly');
 
-        //var request = tx.objectStore(FILE_STORE_).get(fullPath);
+        // var request = tx.objectStore(FILE_STORE_).get(fullPath);
         var range = IDBKeyRange.bound(fullPath, fullPath + DIR_OPEN_BOUND,
             false, true);
         var request = tx.objectStore(FILE_STORE_).get(range);
 
         tx.onabort = errorCallback || onError;
-        tx.oncomplete = function(e) {
+        tx.oncomplete = function (e) {
             successCallback(request.result);
         };
     };
 
-    idb_.getAllEntries = function(fullPath, storagePath, successCallback, errorCallback) {
+    idb_.getAllEntries = function (fullPath, storagePath, successCallback, errorCallback) {
         if (!this.db) {
             if (errorCallback) {
                 errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -710,8 +710,8 @@ QUIRKS:
 
         var tx = this.db.transaction([FILE_STORE_], 'readonly');
         tx.onabort = errorCallback || onError;
-        tx.oncomplete = function(e) {
-            results = results.filter(function(val) {
+        tx.oncomplete = function (e) {
+            results = results.filter(function (val) {
                 var valPartsLen = val.fullPath.split(DIR_SEPARATOR).length;
                 var fullPathPartsLen = fullPath.split(DIR_SEPARATOR).length;
 
@@ -733,7 +733,7 @@ QUIRKS:
 
         var request = tx.objectStore(FILE_STORE_).openCursor(range);
 
-        request.onsuccess = function(e) {
+        request.onsuccess = function (e) {
             var cursor = e.target.result;
             if (cursor) {
                 var val = cursor.value;
@@ -744,7 +744,7 @@ QUIRKS:
         };
     };
 
-    idb_['delete'] = function(fullPath, successCallback, errorCallback) {
+    idb_['delete'] = function (fullPath, successCallback, errorCallback) {
         if (!this.db) {
             if (errorCallback) {
                 errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -756,13 +756,13 @@ QUIRKS:
         tx.oncomplete = successCallback;
         tx.onabort = errorCallback || onError;
 
-        //var request = tx.objectStore(FILE_STORE_).delete(fullPath);
+        // var request = tx.objectStore(FILE_STORE_).delete(fullPath);
         var range = IDBKeyRange.bound(
             fullPath, fullPath + DIR_OPEN_BOUND, false, true);
         tx.objectStore(FILE_STORE_)['delete'](range);
     };
 
-    idb_.put = function(entry, storagePath, successCallback, errorCallback) {
+    idb_.put = function (entry, storagePath, successCallback, errorCallback) {
         if (!this.db) {
             if (errorCallback) {
                 errorCallback(FileError.INVALID_MODIFICATION_ERR);
@@ -772,7 +772,7 @@ QUIRKS:
 
         var tx = this.db.transaction([FILE_STORE_], 'readwrite');
         tx.onabort = errorCallback || onError;
-        tx.oncomplete = function(e) {
+        tx.oncomplete = function (e) {
             // TODO: Error is thrown if we pass the request event back instead.
             successCallback(entry);
         };
@@ -781,14 +781,14 @@ QUIRKS:
     };
 
     // Global error handler. Errors bubble from request, to transaction, to db.
-    function onError(e) {
+    function onError (e) {
         switch (e.target.errorCode) {
-            case 12:
-                console.log('Error - Attempt to open db with a lower version than the ' +
+        case 12:
+            console.log('Error - Attempt to open db with a lower version than the ' +
                     'current one.');
-                break;
-            default:
-                console.log('errorCode: ' + e.target.errorCode);
+            break;
+        default:
+            console.log('errorCode: ' + e.target.errorCode);
         }
 
         console.log(e, e.code, e.message);
@@ -802,4 +802,4 @@ QUIRKS:
 
 })(module.exports, window);
 
-require("cordova/exec/proxy").add("File", module.exports);
+require('cordova/exec/proxy').add('File', module.exports);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/5] cordova-plugin-file git commit: CB-12895 : setup eslint and took out jshint

Posted by au...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/DirectoryEntry.js
----------------------------------------------------------------------
diff --git a/www/DirectoryEntry.js b/www/DirectoryEntry.js
index 62f468a..d943f6d 100644
--- a/www/DirectoryEntry.js
+++ b/www/DirectoryEntry.js
@@ -19,12 +19,12 @@
  *
 */
 
-var argscheck = require('cordova/argscheck'),
-    utils = require('cordova/utils'),
-    exec = require('cordova/exec'),
-    Entry = require('./Entry'),
-    FileError = require('./FileError'),
-    DirectoryReader = require('./DirectoryReader');
+var argscheck = require('cordova/argscheck');
+var utils = require('cordova/utils');
+var exec = require('cordova/exec');
+var Entry = require('./Entry');
+var FileError = require('./FileError');
+var DirectoryReader = require('./DirectoryReader');
 
 /**
  * An interface representing a directory on the file system.
@@ -35,15 +35,15 @@ var argscheck = require('cordova/argscheck'),
  * {DOMString} fullPath the absolute full path to the directory (readonly)
  * {FileSystem} filesystem on which the directory resides (readonly)
  */
-var DirectoryEntry = function(name, fullPath, fileSystem, nativeURL) {
+var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
 
     // add trailing slash if it is missing
     if ((fullPath) && !/\/$/.test(fullPath)) {
-        fullPath += "/";
+        fullPath += '/';
     }
     // add trailing slash if it is missing
     if (nativeURL && !/\/$/.test(nativeURL)) {
-        nativeURL += "/";
+        nativeURL += '/';
     }
     DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
 };
@@ -53,7 +53,7 @@ utils.extend(DirectoryEntry, Entry);
 /**
  * Creates a new DirectoryReader to read entries from this directory
  */
-DirectoryEntry.prototype.createReader = function() {
+DirectoryEntry.prototype.createReader = function () {
     return new DirectoryReader(this.toInternalURL());
 };
 
@@ -65,17 +65,17 @@ DirectoryEntry.prototype.createReader = function() {
  * @param {Function} successCallback is called with the new entry
  * @param {Function} errorCallback is called with a FileError
  */
-DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) {
+DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
     argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
     var fs = this.filesystem;
-    var win = successCallback && function(result) {
+    var win = successCallback && function (result) {
         var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
         successCallback(entry);
     };
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    exec(win, fail, "File", "getDirectory", [this.toInternalURL(), path, options]);
+    exec(win, fail, 'File', 'getDirectory', [this.toInternalURL(), path, options]);
 };
 
 /**
@@ -84,12 +84,12 @@ DirectoryEntry.prototype.getDirectory = function(path, options, successCallback,
  * @param {Function} successCallback is called with no parameters
  * @param {Function} errorCallback is called with a FileError
  */
-DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) {
+DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
     argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    exec(successCallback, fail, "File", "removeRecursively", [this.toInternalURL()]);
+    exec(successCallback, fail, 'File', 'removeRecursively', [this.toInternalURL()]);
 };
 
 /**
@@ -100,18 +100,18 @@ DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCall
  * @param {Function} successCallback is called with the new entry
  * @param {Function} errorCallback is called with a FileError
  */
-DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) {
+DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
     argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
     var fs = this.filesystem;
-    var win = successCallback && function(result) {
+    var win = successCallback && function (result) {
         var FileEntry = require('./FileEntry');
         var entry = new FileEntry(result.name, result.fullPath, fs, result.nativeURL);
         successCallback(entry);
     };
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    exec(win, fail, "File", "getFile", [this.toInternalURL(), path, options]);
+    exec(win, fail, 'File', 'getFile', [this.toInternalURL(), path, options]);
 };
 
 module.exports = DirectoryEntry;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/DirectoryReader.js
----------------------------------------------------------------------
diff --git a/www/DirectoryReader.js b/www/DirectoryReader.js
index 2894c9a..7366953 100644
--- a/www/DirectoryReader.js
+++ b/www/DirectoryReader.js
@@ -19,13 +19,13 @@
  *
 */
 
-var exec = require('cordova/exec'),
-    FileError = require('./FileError') ;
+var exec = require('cordova/exec');
+var FileError = require('./FileError');
 
 /**
  * An interface that lists the files and directories in a directory.
  */
-function DirectoryReader(localURL) {
+function DirectoryReader (localURL) {
     this.localURL = localURL || null;
     this.hasReadEntries = false;
 }
@@ -36,21 +36,20 @@ function DirectoryReader(localURL) {
  * @param {Function} successCallback is called with a list of entries
  * @param {Function} errorCallback is called with a FileError
  */
-DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) {
+DirectoryReader.prototype.readEntries = function (successCallback, errorCallback) {
     // If we've already read and passed on this directory's entries, return an empty list.
     if (this.hasReadEntries) {
         successCallback([]);
         return;
     }
     var reader = this;
-    var win = typeof successCallback !== 'function' ? null : function(result) {
+    var win = typeof successCallback !== 'function' ? null : function (result) {
         var retVal = [];
-        for (var i=0; i<result.length; i++) {
+        for (var i = 0; i < result.length; i++) {
             var entry = null;
             if (result[i].isDirectory) {
                 entry = new (require('./DirectoryEntry'))();
-            }
-            else if (result[i].isFile) {
+            } else if (result[i].isFile) {
                 entry = new (require('./FileEntry'))();
             }
             entry.isDirectory = result[i].isDirectory;
@@ -64,10 +63,10 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback)
         reader.hasReadEntries = true;
         successCallback(retVal);
     };
-    var fail = typeof errorCallback !== 'function' ? null : function(code) {
+    var fail = typeof errorCallback !== 'function' ? null : function (code) {
         errorCallback(new FileError(code));
     };
-    exec(win, fail, "File", "readEntries", [this.localURL]);
+    exec(win, fail, 'File', 'readEntries', [this.localURL]);
 };
 
 module.exports = DirectoryReader;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/Entry.js
----------------------------------------------------------------------
diff --git a/www/Entry.js b/www/Entry.js
index 00ee023..8f7a927 100644
--- a/www/Entry.js
+++ b/www/Entry.js
@@ -19,10 +19,10 @@
  *
 */
 
-var argscheck = require('cordova/argscheck'),
-    exec = require('cordova/exec'),
-    FileError = require('./FileError'),
-    Metadata = require('./Metadata');
+var argscheck = require('cordova/argscheck');
+var exec = require('cordova/exec');
+var FileError = require('./FileError');
+var Metadata = require('./Metadata');
 
 /**
  * Represents a file or directory on the local file system.
@@ -45,7 +45,7 @@ var argscheck = require('cordova/argscheck'),
  *            webview controls, for example media players.
  *            (optional, readonly)
  */
-function Entry(isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
+function Entry (isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
     this.isFile = !!isFile;
     this.isDirectory = !!isDirectory;
     this.name = name || '';
@@ -62,19 +62,19 @@ function Entry(isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
  * @param errorCallback
  *            {Function} is called with a FileError
  */
-Entry.prototype.getMetadata = function(successCallback, errorCallback) {
+Entry.prototype.getMetadata = function (successCallback, errorCallback) {
     argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
-    var success = successCallback && function(entryMetadata) {
+    var success = successCallback && function (entryMetadata) {
         var metadata = new Metadata({
             size: entryMetadata.size,
             modificationTime: entryMetadata.lastModifiedDate
         });
         successCallback(metadata);
     };
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    exec(success, fail, "File", "getFileMetadata", [this.toInternalURL()]);
+    exec(success, fail, 'File', 'getFileMetadata', [this.toInternalURL()]);
 };
 
 /**
@@ -87,9 +87,9 @@ Entry.prototype.getMetadata = function(successCallback, errorCallback) {
  * @param metadataObject
  *            {Object} keys and values to set
  */
-Entry.prototype.setMetadata = function(successCallback, errorCallback, metadataObject) {
+Entry.prototype.setMetadata = function (successCallback, errorCallback, metadataObject) {
     argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
-    exec(successCallback, errorCallback, "File", "setMetadata", [this.toInternalURL(), metadataObject]);
+    exec(successCallback, errorCallback, 'File', 'setMetadata', [this.toInternalURL(), metadataObject]);
 };
 
 /**
@@ -104,34 +104,33 @@ Entry.prototype.setMetadata = function(successCallback, errorCallback, metadataO
  * @param errorCallback
  *            {Function} called with a FileError
  */
-Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {
+Entry.prototype.moveTo = function (parent, newName, successCallback, errorCallback) {
     argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    var srcURL = this.toInternalURL(),
-        // entry name
-        name = newName || this.name,
-        success = function(entry) {
-            if (entry) {
-                if (successCallback) {
-                    // create appropriate Entry object
-                    var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
-                    var fs = newFSName ? new FileSystem(newFSName, { name: "", fullPath: "/" }) : new FileSystem(parent.filesystem.name, { name: "", fullPath: "/" });
-                    var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
-                    successCallback(result);
-                }
+    var srcURL = this.toInternalURL();
+    // entry name
+    var name = newName || this.name;
+    var success = function (entry) {
+        if (entry) {
+            if (successCallback) {
+                // create appropriate Entry object
+                var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
+                var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
+                var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
+                successCallback(result);
             }
-            else {
-                // no Entry object returned
-                if (fail) {
-                    fail(FileError.NOT_FOUND_ERR);
-                }
+        } else {
+            // no Entry object returned
+            if (fail) {
+                fail(FileError.NOT_FOUND_ERR);
             }
-        };
+        }
+    };
 
     // copy
-    exec(success, fail, "File", "moveTo", [srcURL, parent.toInternalURL(), name]);
+    exec(success, fail, 'File', 'moveTo', [srcURL, parent.toInternalURL(), name]);
 };
 
 /**
@@ -146,43 +145,42 @@ Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallbac
  * @param errorCallback
  *            {Function} called with a FileError
  */
-Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {
+Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallback) {
     argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    var srcURL = this.toInternalURL(),
+    var srcURL = this.toInternalURL();
         // entry name
-        name = newName || this.name,
-        // success callback
-        success = function(entry) {
-            if (entry) {
-                if (successCallback) {
-                    // create appropriate Entry object
-                    var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
-                    var fs = newFSName ? new FileSystem(newFSName, { name: "", fullPath: "/" }) : new FileSystem(parent.filesystem.name, { name: "", fullPath: "/" });
-                    var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
-                    successCallback(result);
-                }
+    var name = newName || this.name;
+    // success callback
+    var success = function (entry) {
+        if (entry) {
+            if (successCallback) {
+                // create appropriate Entry object
+                var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
+                var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
+                var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
+                successCallback(result);
             }
-            else {
-                // no Entry object returned
-                if (fail) {
-                    fail(FileError.NOT_FOUND_ERR);
-                }
+        } else {
+            // no Entry object returned
+            if (fail) {
+                fail(FileError.NOT_FOUND_ERR);
             }
-        };
+        }
+    };
 
     // copy
-    exec(success, fail, "File", "copyTo", [srcURL, parent.toInternalURL(), name]);
+    exec(success, fail, 'File', 'copyTo', [srcURL, parent.toInternalURL(), name]);
 };
 
 /**
  * Return a URL that can be passed across the bridge to identify this entry.
  */
-Entry.prototype.toInternalURL = function() {
+Entry.prototype.toInternalURL = function () {
     if (this.filesystem && this.filesystem.__format__) {
-      return this.filesystem.__format__(this.fullPath, this.nativeURL);
+        return this.filesystem.__format__(this.fullPath, this.nativeURL);
     }
 };
 
@@ -191,13 +189,13 @@ Entry.prototype.toInternalURL = function() {
  * Use a URL that can be used to as the src attribute of a <video> or
  * <audio> tag. If that is not possible, construct a cdvfile:// URL.
  */
-Entry.prototype.toURL = function() {
+Entry.prototype.toURL = function () {
     if (this.nativeURL) {
-      return this.nativeURL;
+        return this.nativeURL;
     }
     // fullPath attribute may contain the full URL in the case that
     // toInternalURL fails.
-    return this.toInternalURL() || "file://localhost" + this.fullPath;
+    return this.toInternalURL() || 'file://localhost' + this.fullPath;
 };
 
 /**
@@ -207,7 +205,7 @@ Entry.prototype.toURL = function() {
  * See CB-6051, CB-6106, CB-6117, CB-6152, CB-6199, CB-6201, CB-6243, CB-6249,
  * and CB-6300.
  */
-Entry.prototype.toNativeURL = function() {
+Entry.prototype.toNativeURL = function () {
     console.log("DEPRECATED: Update your code to use 'toURL'");
     return this.toURL();
 };
@@ -218,7 +216,7 @@ Entry.prototype.toNativeURL = function() {
  * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.
  * @return uri
  */
-Entry.prototype.toURI = function(mimeType) {
+Entry.prototype.toURI = function (mimeType) {
     console.log("DEPRECATED: Update your code to use 'toURL'");
     return this.toURL();
 };
@@ -231,12 +229,12 @@ Entry.prototype.toURI = function(mimeType) {
  * @param successCallback {Function} called with no parameters
  * @param errorCallback {Function} called with a FileError
  */
-Entry.prototype.remove = function(successCallback, errorCallback) {
+Entry.prototype.remove = function (successCallback, errorCallback) {
     argscheck.checkArgs('FF', 'Entry.remove', arguments);
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    exec(successCallback, fail, "File", "remove", [this.toInternalURL()]);
+    exec(successCallback, fail, 'File', 'remove', [this.toInternalURL()]);
 };
 
 /**
@@ -245,18 +243,18 @@ Entry.prototype.remove = function(successCallback, errorCallback) {
  * @param successCallback {Function} called with the parent DirectoryEntry object
  * @param errorCallback {Function} called with a FileError
  */
-Entry.prototype.getParent = function(successCallback, errorCallback) {
+Entry.prototype.getParent = function (successCallback, errorCallback) {
     argscheck.checkArgs('FF', 'Entry.getParent', arguments);
     var fs = this.filesystem;
-    var win = successCallback && function(result) {
+    var win = successCallback && function (result) {
         var DirectoryEntry = require('./DirectoryEntry');
         var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
         successCallback(entry);
     };
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    exec(win, fail, "File", "getParent", [this.toInternalURL()]);
+    exec(win, fail, 'File', 'getParent', [this.toInternalURL()]);
 };
 
 module.exports = Entry;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/File.js
----------------------------------------------------------------------
diff --git a/www/File.js b/www/File.js
index 82ff7a7..30c6202 100644
--- a/www/File.js
+++ b/www/File.js
@@ -28,7 +28,7 @@
  * size {Number} size of the file in bytes
  */
 
-var File = function(name, localURL, type, lastModifiedDate, size){
+var File = function (name, localURL, type, lastModifiedDate, size) {
     this.name = name || '';
     this.localURL = localURL || null;
     this.type = type || null;
@@ -49,7 +49,7 @@ var File = function(name, localURL, type, lastModifiedDate, size){
  * start {Number} The index at which to start the slice (inclusive).
  * end {Number} The index at which to end the slice (exclusive).
  */
-File.prototype.slice = function(start, end) {
+File.prototype.slice = function (start, end) {
     var size = this.end - this.start;
     var newStart = 0;
     var newEnd = size;
@@ -75,5 +75,4 @@ File.prototype.slice = function(start, end) {
     return newFile;
 };
 
-
 module.exports = File;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/FileEntry.js
----------------------------------------------------------------------
diff --git a/www/FileEntry.js b/www/FileEntry.js
index c0b7c64..8ed230c 100644
--- a/www/FileEntry.js
+++ b/www/FileEntry.js
@@ -19,12 +19,12 @@
  *
 */
 
-var utils = require('cordova/utils'),
-    exec = require('cordova/exec'),
-    Entry = require('./Entry'),
-    FileWriter = require('./FileWriter'),
-    File = require('./File'),
-    FileError = require('./FileError');
+var utils = require('cordova/utils');
+var exec = require('cordova/exec');
+var Entry = require('./Entry');
+var FileWriter = require('./FileWriter');
+var File = require('./File');
+var FileError = require('./FileError');
 
 /**
  * An interface representing a file on the file system.
@@ -35,7 +35,7 @@ var utils = require('cordova/utils'),
  * {DOMString} fullPath the absolute full path to the file (readonly)
  * {FileSystem} filesystem on which the file resides (readonly)
  */
-var FileEntry = function(name, fullPath, fileSystem, nativeURL) {
+var FileEntry = function (name, fullPath, fileSystem, nativeURL) {
     // remove trailing slash if it is present
     if (fullPath && /\/$/.test(fullPath)) {
         fullPath = fullPath.substring(0, fullPath.length - 1);
@@ -55,11 +55,11 @@ utils.extend(FileEntry, Entry);
  * @param {Function} successCallback is called with the new FileWriter
  * @param {Function} errorCallback is called with a FileError
  */
-FileEntry.prototype.createWriter = function(successCallback, errorCallback) {
-    this.file(function(filePointer) {
+FileEntry.prototype.createWriter = function (successCallback, errorCallback) {
+    this.file(function (filePointer) {
         var writer = new FileWriter(filePointer);
 
-        if (writer.localURL === null || writer.localURL === "") {
+        if (writer.localURL === null || writer.localURL === '') {
             if (errorCallback) {
                 errorCallback(new FileError(FileError.INVALID_STATE_ERR));
             }
@@ -77,17 +77,16 @@ FileEntry.prototype.createWriter = function(successCallback, errorCallback) {
  * @param {Function} successCallback is called with the new File object
  * @param {Function} errorCallback is called with a FileError
  */
-FileEntry.prototype.file = function(successCallback, errorCallback) {
+FileEntry.prototype.file = function (successCallback, errorCallback) {
     var localURL = this.toInternalURL();
-    var win = successCallback && function(f) {
+    var win = successCallback && function (f) {
         var file = new File(f.name, localURL, f.type, f.lastModifiedDate, f.size);
         successCallback(file);
     };
-    var fail = errorCallback && function(code) {
+    var fail = errorCallback && function (code) {
         errorCallback(new FileError(code));
     };
-    exec(win, fail, "File", "getFileMetadata", [localURL]);
+    exec(win, fail, 'File', 'getFileMetadata', [localURL]);
 };
 
-
 module.exports = FileEntry;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/FileError.js
----------------------------------------------------------------------
diff --git a/www/FileError.js b/www/FileError.js
index 6507921..16bdf31 100644
--- a/www/FileError.js
+++ b/www/FileError.js
@@ -22,8 +22,8 @@
 /**
  * FileError
  */
-function FileError(error) {
-  this.code = error || null;
+function FileError (error) {
+    this.code = error || null;
 }
 
 // File error codes

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/FileReader.js
----------------------------------------------------------------------
diff --git a/www/FileReader.js b/www/FileReader.js
index 8d2f086..9115f5f 100644
--- a/www/FileReader.js
+++ b/www/FileReader.js
@@ -19,12 +19,12 @@
  *
 */
 
-var exec = require('cordova/exec'),
-    modulemapper = require('cordova/modulemapper'),
-    utils = require('cordova/utils'),
-    FileError = require('./FileError'),
-    ProgressEvent = require('./ProgressEvent'),
-    origFileReader = modulemapper.getOriginalSymbol(window, 'FileReader');
+var exec = require('cordova/exec');
+var modulemapper = require('cordova/modulemapper');
+var utils = require('cordova/utils');
+var FileError = require('./FileError');
+var ProgressEvent = require('./ProgressEvent');
+var origFileReader = modulemapper.getOriginalSymbol(window, 'FileReader');
 
 /**
  * This class reads the mobile device file system.
@@ -34,13 +34,13 @@ var exec = require('cordova/exec'),
  *      To read from the SD card, the file name is "sdcard/my_file.txt"
  * @constructor
  */
-var FileReader = function() {
+var FileReader = function () {
     this._readyState = 0;
     this._error = null;
     this._result = null;
     this._progress = null;
     this._localURL = '';
-    this._realReader = origFileReader ? new origFileReader() : {};
+    this._realReader = origFileReader ? new origFileReader() : {}; // eslint-disable-line new-cap
 };
 
 /**
@@ -49,29 +49,29 @@ var FileReader = function() {
  * (Note attempts to allocate more than a few MB of contiguous memory on the native side are likely to cause
  * OOM exceptions, while the JS engine seems to have fewer problems managing large strings or ArrayBuffers.)
  */
-FileReader.READ_CHUNK_SIZE = 256*1024;
+FileReader.READ_CHUNK_SIZE = 256 * 1024;
 
 // States
 FileReader.EMPTY = 0;
 FileReader.LOADING = 1;
 FileReader.DONE = 2;
 
-utils.defineGetter(FileReader.prototype, 'readyState', function() {
+utils.defineGetter(FileReader.prototype, 'readyState', function () {
     return this._localURL ? this._readyState : this._realReader.readyState;
 });
 
-utils.defineGetter(FileReader.prototype, 'error', function() {
-    return this._localURL ? this._error: this._realReader.error;
+utils.defineGetter(FileReader.prototype, 'error', function () {
+    return this._localURL ? this._error : this._realReader.error;
 });
 
-utils.defineGetter(FileReader.prototype, 'result', function() {
-    return this._localURL ? this._result: this._realReader.result;
+utils.defineGetter(FileReader.prototype, 'result', function () {
+    return this._localURL ? this._result : this._realReader.result;
 });
 
-function defineEvent(eventName) {
-    utils.defineGetterSetter(FileReader.prototype, eventName, function() {
+function defineEvent (eventName) {
+    utils.defineGetterSetter(FileReader.prototype, eventName, function () {
         return this._realReader[eventName] || null;
-    }, function(value) {
+    }, function (value) {
         this._realReader[eventName] = value;
     });
 }
@@ -82,10 +82,10 @@ defineEvent('onerror');        // When the read has failed (see errors).
 defineEvent('onloadend');      // When the request has completed (either in success or failure).
 defineEvent('onabort');        // When the read has been aborted. For instance, by invoking the abort() method.
 
-function initRead(reader, file) {
+function initRead (reader, file) {
     // Already loading something
-    if (reader.readyState == FileReader.LOADING) {
-      throw new FileError(FileError.INVALID_STATE_ERR);
+    if (reader.readyState === FileReader.LOADING) {
+        throw new FileError(FileError.INVALID_STATE_ERR);
     }
 
     reader._result = null;
@@ -93,7 +93,7 @@ function initRead(reader, file) {
     reader._progress = 0;
     reader._readyState = FileReader.LOADING;
 
-    if (typeof file.localURL == 'string') {
+    if (typeof file.localURL === 'string') {
         reader._localURL = file.localURL;
     } else {
         reader._localURL = '';
@@ -101,7 +101,7 @@ function initRead(reader, file) {
     }
 
     if (reader.onloadstart) {
-        reader.onloadstart(new ProgressEvent("loadstart", {target:reader}));
+        reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
     }
 }
 
@@ -116,7 +116,7 @@ function initRead(reader, file) {
  * @param accumulate A function that takes the callback result and accumulates it in this._result.
  * @param r Callback result returned by the last read exec() call, or null to begin reading.
  */
-function readSuccessCallback(readType, encoding, offset, totalSize, accumulate, r) {
+function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, r) {
     if (this._readyState === FileReader.DONE) {
         return;
     }
@@ -125,22 +125,22 @@ function readSuccessCallback(readType, encoding, offset, totalSize, accumulate,
     if (readType === 'readAsDataURL') {
         // Windows proxy does not support reading file slices as Data URLs
         // so read the whole file at once.
-        CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize :
+        CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
             // Calculate new chunk size for data URLs to be multiply of 3
             // Otherwise concatenated base64 chunks won't be valid base64 data
             FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
     }
 
-    if (typeof r !== "undefined") {
+    if (typeof r !== 'undefined') {
         accumulate(r);
         this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
 
-        if (typeof this.onprogress === "function") {
-            this.onprogress(new ProgressEvent("progress", {loaded:this._progress, total:totalSize}));
+        if (typeof this.onprogress === 'function') {
+            this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
         }
     }
 
-    if (typeof r === "undefined" || this._progress < totalSize) {
+    if (typeof r === 'undefined' || this._progress < totalSize) {
         var execArgs = [
             this._localURL,
             offset + this._progress,
@@ -151,16 +151,16 @@ function readSuccessCallback(readType, encoding, offset, totalSize, accumulate,
         exec(
             readSuccessCallback.bind(this, readType, encoding, offset, totalSize, accumulate),
             readFailureCallback.bind(this),
-            "File", readType, execArgs);
+            'File', readType, execArgs);
     } else {
         this._readyState = FileReader.DONE;
 
-        if (typeof this.onload === "function") {
-            this.onload(new ProgressEvent("load", {target:this}));
+        if (typeof this.onload === 'function') {
+            this.onload(new ProgressEvent('load', {target: this}));
         }
 
-        if (typeof this.onloadend === "function") {
-            this.onloadend(new ProgressEvent("loadend", {target:this}));
+        if (typeof this.onloadend === 'function') {
+            this.onloadend(new ProgressEvent('loadend', {target: this}));
         }
     }
 }
@@ -169,7 +169,7 @@ function readSuccessCallback(readType, encoding, offset, totalSize, accumulate,
  * Callback used by the following read* functions to handle errors.
  * Must be bound to the FileReader's this, e.g. readFailureCallback.bind(this)
  */
-function readFailureCallback(e) {
+function readFailureCallback (e) {
     if (this._readyState === FileReader.DONE) {
         return;
     }
@@ -178,37 +178,37 @@ function readFailureCallback(e) {
     this._result = null;
     this._error = new FileError(e);
 
-    if (typeof this.onerror === "function") {
-        this.onerror(new ProgressEvent("error", {target:this}));
+    if (typeof this.onerror === 'function') {
+        this.onerror(new ProgressEvent('error', {target: this}));
     }
 
-    if (typeof this.onloadend === "function") {
-        this.onloadend(new ProgressEvent("loadend", {target:this}));
+    if (typeof this.onloadend === 'function') {
+        this.onloadend(new ProgressEvent('loadend', {target: this}));
     }
 }
 
 /**
  * Abort reading file.
  */
-FileReader.prototype.abort = function() {
+FileReader.prototype.abort = function () {
     if (origFileReader && !this._localURL) {
         return this._realReader.abort();
     }
     this._result = null;
 
-    if (this._readyState == FileReader.DONE || this._readyState == FileReader.EMPTY) {
-      return;
+    if (this._readyState === FileReader.DONE || this._readyState === FileReader.EMPTY) {
+        return;
     }
 
     this._readyState = FileReader.DONE;
 
     // If abort callback
     if (typeof this.onabort === 'function') {
-        this.onabort(new ProgressEvent('abort', {target:this}));
+        this.onabort(new ProgressEvent('abort', {target: this}));
     }
     // If load end callback
     if (typeof this.onloadend === 'function') {
-        this.onloadend(new ProgressEvent('loadend', {target:this}));
+        this.onloadend(new ProgressEvent('loadend', {target: this}));
     }
 };
 
@@ -218,24 +218,23 @@ FileReader.prototype.abort = function() {
  * @param file          {File} File object containing file properties
  * @param encoding      [Optional] (see http://www.iana.org/assignments/character-sets)
  */
-FileReader.prototype.readAsText = function(file, encoding) {
+FileReader.prototype.readAsText = function (file, encoding) {
     if (initRead(this, file)) {
         return this._realReader.readAsText(file, encoding);
     }
 
     // Default encoding is UTF-8
-    var enc = encoding ? encoding : "UTF-8";
+    var enc = encoding || 'UTF-8';
 
     var totalSize = file.end - file.start;
-    readSuccessCallback.bind(this)("readAsText", enc, file.start, totalSize, function(r) {
+    readSuccessCallback.bind(this)('readAsText', enc, file.start, totalSize, function (r) {
         if (this._progress === 0) {
-            this._result = "";
+            this._result = '';
         }
         this._result += r;
     }.bind(this));
 };
 
-
 /**
  * Read file and return data as a base64 encoded data url.
  * A data url is of the form:
@@ -243,13 +242,13 @@ FileReader.prototype.readAsText = function(file, encoding) {
  *
  * @param file          {File} File object containing file properties
  */
-FileReader.prototype.readAsDataURL = function(file) {
+FileReader.prototype.readAsDataURL = function (file) {
     if (initRead(this, file)) {
         return this._realReader.readAsDataURL(file);
     }
 
     var totalSize = file.end - file.start;
-    readSuccessCallback.bind(this)("readAsDataURL", null, file.start, totalSize, function(r) {
+    readSuccessCallback.bind(this)('readAsDataURL', null, file.start, totalSize, function (r) {
         var commaIndex = r.indexOf(',');
         if (this._progress === 0) {
             this._result = r;
@@ -264,15 +263,15 @@ FileReader.prototype.readAsDataURL = function(file) {
  *
  * @param file          {File} File object containing file properties
  */
-FileReader.prototype.readAsBinaryString = function(file) {
+FileReader.prototype.readAsBinaryString = function (file) {
     if (initRead(this, file)) {
         return this._realReader.readAsBinaryString(file);
     }
 
     var totalSize = file.end - file.start;
-    readSuccessCallback.bind(this)("readAsBinaryString", null, file.start, totalSize, function(r) {
+    readSuccessCallback.bind(this)('readAsBinaryString', null, file.start, totalSize, function (r) {
         if (this._progress === 0) {
-            this._result = "";
+            this._result = '';
         }
         this._result += r;
     }.bind(this));
@@ -283,13 +282,13 @@ FileReader.prototype.readAsBinaryString = function(file) {
  *
  * @param file          {File} File object containing file properties
  */
-FileReader.prototype.readAsArrayBuffer = function(file) {
+FileReader.prototype.readAsArrayBuffer = function (file) {
     if (initRead(this, file)) {
         return this._realReader.readAsArrayBuffer(file);
     }
 
     var totalSize = file.end - file.start;
-    readSuccessCallback.bind(this)("readAsArrayBuffer", null, file.start, totalSize, function(r) {
+    readSuccessCallback.bind(this)('readAsArrayBuffer', null, file.start, totalSize, function (r) {
         var resultArray = (this._progress === 0 ? new Uint8Array(totalSize) : new Uint8Array(this._result));
         resultArray.set(new Uint8Array(r), this._progress);
         this._result = resultArray.buffer;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/FileSystem.js b/www/FileSystem.js
index 82f9175..f90c458 100644
--- a/www/FileSystem.js
+++ b/www/FileSystem.js
@@ -28,7 +28,7 @@ var DirectoryEntry = require('./DirectoryEntry');
  * {DOMString} name the unique name of the file system (readonly)
  * {DirectoryEntry} root directory of the file system (readonly)
  */
-var FileSystem = function(name, root) {
+var FileSystem = function (name, root) {
     this.name = name;
     if (root) {
         this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
@@ -37,16 +37,16 @@ var FileSystem = function(name, root) {
     }
 };
 
-FileSystem.prototype.__format__ = function(fullPath, nativeUrl) {
+FileSystem.prototype.__format__ = function (fullPath, nativeUrl) {
     return fullPath;
 };
 
-FileSystem.prototype.toJSON = function() {
-    return "<FileSystem: " + this.name + ">";
+FileSystem.prototype.toJSON = function () {
+    return '<FileSystem: ' + this.name + '>';
 };
 
 // Use instead of encodeURI() when encoding just the path part of a URI rather than an entire URI.
-FileSystem.encodeURIPath = function(path) {
+FileSystem.encodeURIPath = function (path) {
     // Because # is a valid filename character, it must be encoded to prevent part of the
     // path from being parsed as a URI fragment.
     return encodeURI(path).replace(/#/g, '%23');

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/FileUploadOptions.js
----------------------------------------------------------------------
diff --git a/www/FileUploadOptions.js b/www/FileUploadOptions.js
index b2977de..b4aa7c7 100644
--- a/www/FileUploadOptions.js
+++ b/www/FileUploadOptions.js
@@ -29,7 +29,7 @@
  * @param headers {Object}   Keys are header names, values are header values. Multiple
  *                           headers of the same name are not supported.
  */
-var FileUploadOptions = function(fileKey, fileName, mimeType, params, headers, httpMethod) {
+var FileUploadOptions = function (fileKey, fileName, mimeType, params, headers, httpMethod) {
     this.fileKey = fileKey || null;
     this.fileName = fileName || null;
     this.mimeType = mimeType || null;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/FileUploadResult.js
----------------------------------------------------------------------
diff --git a/www/FileUploadResult.js b/www/FileUploadResult.js
index 4f2e33e..6c7105c 100644
--- a/www/FileUploadResult.js
+++ b/www/FileUploadResult.js
@@ -23,8 +23,8 @@
  * FileUploadResult
  * @constructor
  */
-module.exports = function FileUploadResult(size, code, content) {
-	this.bytesSent = size;
-	this.responseCode = code;
-	this.response = content;
- };
\ No newline at end of file
+module.exports = function FileUploadResult (size, code, content) {
+    this.bytesSent = size;
+    this.responseCode = code;
+    this.response = content;
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/FileWriter.js
----------------------------------------------------------------------
diff --git a/www/FileWriter.js b/www/FileWriter.js
index a3c686f..c6de375 100644
--- a/www/FileWriter.js
+++ b/www/FileWriter.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -19,9 +19,9 @@
  *
 */
 
-var exec = require('cordova/exec'),
-    FileError = require('./FileError'),
-    ProgressEvent = require('./ProgressEvent');
+var exec = require('cordova/exec');
+var FileError = require('./FileError');
+var ProgressEvent = require('./ProgressEvent');
 
 /**
  * This class writes to the mobile device file system.
@@ -34,8 +34,8 @@ var exec = require('cordova/exec'),
  * @param file {File} File object containing file properties
  * @param append if true write to the end of the file, otherwise overwrite the file
  */
-var FileWriter = function(file) {
-    this.fileName = "";
+var FileWriter = function (file) {
+    this.fileName = '';
     this.length = 0;
     if (file) {
         this.localURL = file.localURL || file;
@@ -68,7 +68,7 @@ FileWriter.DONE = 2;
 /**
  * Abort writing file.
  */
-FileWriter.prototype.abort = function() {
+FileWriter.prototype.abort = function () {
     // check for invalid state
     if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {
         throw new FileError(FileError.INVALID_STATE_ERR);
@@ -80,13 +80,13 @@ FileWriter.prototype.abort = function() {
     this.readyState = FileWriter.DONE;
 
     // If abort callback
-    if (typeof this.onabort === "function") {
-        this.onabort(new ProgressEvent("abort", {"target":this}));
+    if (typeof this.onabort === 'function') {
+        this.onabort(new ProgressEvent('abort', {'target': this}));
     }
 
     // If write end callback
-    if (typeof this.onwriteend === "function") {
-        this.onwriteend(new ProgressEvent("writeend", {"target":this}));
+    if (typeof this.onwriteend === 'function') {
+        this.onwriteend(new ProgressEvent('writeend', {'target': this}));
     }
 };
 
@@ -96,17 +96,19 @@ FileWriter.prototype.abort = function() {
  * @param data text or blob to be written
  * @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
  */
-FileWriter.prototype.write = function(data, isPendingBlobReadResult) {
+FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
 
-    var that=this;
+    var that = this;
     var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
-    var isProxySupportBlobNatively = (cordova.platformId === "windows8" || cordova.platformId === "windows");
+    /* eslint-disable no-undef */
+    var isProxySupportBlobNatively = (cordova.platformId === 'windows8' || cordova.platformId === 'windows');
     var isBinary;
 
     // Check to see if the incoming data is a blob
     if (data instanceof File || (!isProxySupportBlobNatively && supportsBinary && data instanceof Blob)) {
         var fileReader = new FileReader();
-        fileReader.onload = function() {
+        /* eslint-enable no-undef */
+        fileReader.onload = function () {
             // Call this method again, with the arraybuffer as argument
             FileWriter.prototype.write.call(that, this.result, true /* isPendingBlobReadResult */);
         };
@@ -118,13 +120,13 @@ FileWriter.prototype.write = function(data, isPendingBlobReadResult) {
             that.error = this.error;
 
             // If onerror callback
-            if (typeof that.onerror === "function") {
-                that.onerror(new ProgressEvent("error", {"target":that}));
+            if (typeof that.onerror === 'function') {
+                that.onerror(new ProgressEvent('error', {'target': that}));
             }
 
             // If onwriteend callback
-            if (typeof that.onwriteend === "function") {
-                that.onwriteend(new ProgressEvent("writeend", {"target":that}));
+            if (typeof that.onwriteend === 'function') {
+                that.onwriteend(new ProgressEvent('writeend', {'target': that}));
             }
         };
 
@@ -141,11 +143,11 @@ FileWriter.prototype.write = function(data, isPendingBlobReadResult) {
 
     // Mark data type for safer transport over the binary bridge
     isBinary = supportsBinary && (data instanceof ArrayBuffer);
-    if (isBinary && cordova.platformId === "windowsphone") {
+    if (isBinary && cordova.platformId === 'windowsphone') { // eslint-disable-line no-undef
         // create a plain array, using the keys from the Uint8Array view so that we can serialize it
         data = Array.apply(null, new Uint8Array(data));
     }
-    
+
     // Throw an exception if we are already writing a file
     if (this.readyState === FileWriter.WRITING && !isPendingBlobReadResult) {
         throw new FileError(FileError.INVALID_STATE_ERR);
@@ -157,14 +159,14 @@ FileWriter.prototype.write = function(data, isPendingBlobReadResult) {
     var me = this;
 
     // If onwritestart callback
-    if (typeof me.onwritestart === "function") {
-        me.onwritestart(new ProgressEvent("writestart", {"target":me}));
+    if (typeof me.onwritestart === 'function') {
+        me.onwritestart(new ProgressEvent('writestart', {'target': me}));
     }
 
     // Write file
     exec(
         // Success callback
-        function(r) {
+        function (r) {
             // If DONE (cancelled), then don't do anything
             if (me.readyState === FileWriter.DONE) {
                 return;
@@ -180,17 +182,17 @@ FileWriter.prototype.write = function(data, isPendingBlobReadResult) {
             me.readyState = FileWriter.DONE;
 
             // If onwrite callback
-            if (typeof me.onwrite === "function") {
-                me.onwrite(new ProgressEvent("write", {"target":me}));
+            if (typeof me.onwrite === 'function') {
+                me.onwrite(new ProgressEvent('write', {'target': me}));
             }
 
             // If onwriteend callback
-            if (typeof me.onwriteend === "function") {
-                me.onwriteend(new ProgressEvent("writeend", {"target":me}));
+            if (typeof me.onwriteend === 'function') {
+                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
             }
         },
         // Error callback
-        function(e) {
+        function (e) {
             // If DONE (cancelled), then don't do anything
             if (me.readyState === FileWriter.DONE) {
                 return;
@@ -203,15 +205,15 @@ FileWriter.prototype.write = function(data, isPendingBlobReadResult) {
             me.error = new FileError(e);
 
             // If onerror callback
-            if (typeof me.onerror === "function") {
-                me.onerror(new ProgressEvent("error", {"target":me}));
+            if (typeof me.onerror === 'function') {
+                me.onerror(new ProgressEvent('error', {'target': me}));
             }
 
             // If onwriteend callback
-            if (typeof me.onwriteend === "function") {
-                me.onwriteend(new ProgressEvent("writeend", {"target":me}));
+            if (typeof me.onwriteend === 'function') {
+                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
             }
-        }, "File", "write", [this.localURL, data, this.position, isBinary]);
+        }, 'File', 'write', [this.localURL, data, this.position, isBinary]);
 };
 
 /**
@@ -223,7 +225,7 @@ FileWriter.prototype.write = function(data, isPendingBlobReadResult) {
  *
  * @param offset is the location to move the file pointer to.
  */
-FileWriter.prototype.seek = function(offset) {
+FileWriter.prototype.seek = function (offset) {
     // Throw an exception if we are already writing a file
     if (this.readyState === FileWriter.WRITING) {
         throw new FileError(FileError.INVALID_STATE_ERR);
@@ -236,15 +238,13 @@ FileWriter.prototype.seek = function(offset) {
     // See back from end of file.
     if (offset < 0) {
         this.position = Math.max(offset + this.length, 0);
-    }
     // Offset is bigger than file size so set position
     // to the end of the file.
-    else if (offset > this.length) {
+    } else if (offset > this.length) {
         this.position = this.length;
-    }
     // Offset is between 0 and file size so set the position
     // to start writing.
-    else {
+    } else {
         this.position = offset;
     }
 };
@@ -254,7 +254,7 @@ FileWriter.prototype.seek = function(offset) {
  *
  * @param size to chop the file at.
  */
-FileWriter.prototype.truncate = function(size) {
+FileWriter.prototype.truncate = function (size) {
     // Throw an exception if we are already writing a file
     if (this.readyState === FileWriter.WRITING) {
         throw new FileError(FileError.INVALID_STATE_ERR);
@@ -266,14 +266,14 @@ FileWriter.prototype.truncate = function(size) {
     var me = this;
 
     // If onwritestart callback
-    if (typeof me.onwritestart === "function") {
-        me.onwritestart(new ProgressEvent("writestart", {"target":this}));
+    if (typeof me.onwritestart === 'function') {
+        me.onwritestart(new ProgressEvent('writestart', {'target': this}));
     }
 
     // Write file
     exec(
         // Success callback
-        function(r) {
+        function (r) {
             // If DONE (cancelled), then don't do anything
             if (me.readyState === FileWriter.DONE) {
                 return;
@@ -287,17 +287,17 @@ FileWriter.prototype.truncate = function(size) {
             me.position = Math.min(me.position, r);
 
             // If onwrite callback
-            if (typeof me.onwrite === "function") {
-                me.onwrite(new ProgressEvent("write", {"target":me}));
+            if (typeof me.onwrite === 'function') {
+                me.onwrite(new ProgressEvent('write', {'target': me}));
             }
 
             // If onwriteend callback
-            if (typeof me.onwriteend === "function") {
-                me.onwriteend(new ProgressEvent("writeend", {"target":me}));
+            if (typeof me.onwriteend === 'function') {
+                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
             }
         },
         // Error callback
-        function(e) {
+        function (e) {
             // If DONE (cancelled), then don't do anything
             if (me.readyState === FileWriter.DONE) {
                 return;
@@ -310,15 +310,15 @@ FileWriter.prototype.truncate = function(size) {
             me.error = new FileError(e);
 
             // If onerror callback
-            if (typeof me.onerror === "function") {
-                me.onerror(new ProgressEvent("error", {"target":me}));
+            if (typeof me.onerror === 'function') {
+                me.onerror(new ProgressEvent('error', {'target': me}));
             }
 
             // If onwriteend callback
-            if (typeof me.onwriteend === "function") {
-                me.onwriteend(new ProgressEvent("writeend", {"target":me}));
+            if (typeof me.onwriteend === 'function') {
+                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
             }
-        }, "File", "truncate", [this.localURL, size]);
+        }, 'File', 'truncate', [this.localURL, size]);
 };
 
 module.exports = FileWriter;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/Flags.js
----------------------------------------------------------------------
diff --git a/www/Flags.js b/www/Flags.js
index a9ae6da..2f15c88 100644
--- a/www/Flags.js
+++ b/www/Flags.js
@@ -28,7 +28,7 @@
  *            {boolean} used with create; if true the command will fail if
  *            target path exists
  */
-function Flags(create, exclusive) {
+function Flags (create, exclusive) {
     this.create = create || false;
     this.exclusive = exclusive || false;
 }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/Metadata.js
----------------------------------------------------------------------
diff --git a/www/Metadata.js b/www/Metadata.js
index f95c44c..713d7cb 100644
--- a/www/Metadata.js
+++ b/www/Metadata.js
@@ -24,11 +24,11 @@
  *
  * {Date} modificationTime (readonly)
  */
-var Metadata = function(metadata) {
-    if (typeof metadata == "object") {
+var Metadata = function (metadata) {
+    if (typeof metadata === 'object') {
         this.modificationTime = new Date(metadata.modificationTime);
         this.size = metadata.size || 0;
-    } else if (typeof metadata == "undefined") {
+    } else if (typeof metadata === 'undefined') {
         this.modificationTime = null;
         this.size = 0;
     } else {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/ProgressEvent.js
----------------------------------------------------------------------
diff --git a/www/ProgressEvent.js b/www/ProgressEvent.js
index f176f80..336a226 100644
--- a/www/ProgressEvent.js
+++ b/www/ProgressEvent.js
@@ -25,7 +25,7 @@
 // otherwise fill-in with our own implementation.
 //
 // NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview.
-var ProgressEvent = (function() {
+var ProgressEvent = (function () {
     /*
     var createEvent = function(data) {
         var event = document.createEvent('Events');
@@ -51,17 +51,17 @@ var ProgressEvent = (function() {
         };
     } catch(e){
     */
-        return function ProgressEvent(type, dict) {
-            this.type = type;
-            this.bubbles = false;
-            this.cancelBubble = false;
-            this.cancelable = false;
-            this.lengthComputable = false;
-            this.loaded = dict && dict.loaded ? dict.loaded : 0;
-            this.total = dict && dict.total ? dict.total : 0;
-            this.target = dict && dict.target ? dict.target : null;
-        };
-    //}
+    return function ProgressEvent (type, dict) {
+        this.type = type;
+        this.bubbles = false;
+        this.cancelBubble = false;
+        this.cancelable = false;
+        this.lengthComputable = false;
+        this.loaded = dict && dict.loaded ? dict.loaded : 0;
+        this.total = dict && dict.total ? dict.total : 0;
+        this.target = dict && dict.target ? dict.target : null;
+    };
+    // }
 })();
 
 module.exports = ProgressEvent;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/android/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/android/FileSystem.js b/www/android/FileSystem.js
index b16333b..438da00 100644
--- a/www/android/FileSystem.js
+++ b/www/android/FileSystem.js
@@ -19,10 +19,10 @@
  *
 */
 
-FILESYSTEM_PROTOCOL = "cdvfile";
+FILESYSTEM_PROTOCOL = 'cdvfile'; // eslint-disable-line no-undef
 
 module.exports = {
-    __format__: function(fullPath, nativeUrl) {
+    __format__: function (fullPath, nativeUrl) {
         var path;
         var contentUrlMatch = /^content:\/\//.exec(nativeUrl);
         if (contentUrlMatch) {
@@ -32,18 +32,17 @@ module.exports = {
             // doesn't match the string for which permission was originally granted.
             path = nativeUrl.substring(contentUrlMatch[0].length - 1);
         } else {
-            path = FileSystem.encodeURIPath(fullPath);
+            path = FileSystem.encodeURIPath(fullPath); // eslint-disable-line no-undef
             if (!/^\//.test(path)) {
                 path = '/' + path;
             }
-            
+
             var m = /\?.*/.exec(nativeUrl);
             if (m) {
                 path += m[0];
             }
         }
 
-        return FILESYSTEM_PROTOCOL + '://localhost/' + this.name + path;
+        return FILESYSTEM_PROTOCOL + '://localhost/' + this.name + path; // eslint-disable-line no-undef
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/FileSystem.js b/www/blackberry10/FileSystem.js
index 255f904..5d663f9 100644
--- a/www/blackberry10/FileSystem.js
+++ b/www/blackberry10/FileSystem.js
@@ -21,27 +21,28 @@
 
 /*
  * FileSystem
- * 
+ *
  * Translate temporary / persistent / root file paths
  */
 
-var info = require("cordova-plugin-file.bb10FileSystemInfo");
+var info = require('cordova-plugin-file.bb10FileSystemInfo');
 
 module.exports = {
-    __format__: function(fullPath) {
+    __format__: function (fullPath) {
         var path;
         switch (this.name) {
-            case 'temporary':
-                path = info.temporaryPath + FileSystem.encodeURIPath(fullPath);
-                break;
-            case 'persistent':
-                path = info.persistentPath + FileSystem.encodeURIPath(fullPath);
-                break;
-            case 'root':
-                path = 'file://' + FileSystem.encodeURIPath(fullPath);
-                break;
+        case 'temporary':
+            /* eslint-disable no-undef */
+            path = info.temporaryPath + FileSystem.encodeURIPath(fullPath);
+            break;
+        case 'persistent':
+            path = info.persistentPath + FileSystem.encodeURIPath(fullPath);
+            break;
+        case 'root':
+            path = 'file://' + FileSystem.encodeURIPath(fullPath);
+            /* eslint-enable no-undef */
+            break;
         }
         return path;
     }
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/copyTo.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/copyTo.js b/www/blackberry10/copyTo.js
index 26f2708..73f3b0f 100644
--- a/www/blackberry10/copyTo.js
+++ b/www/blackberry10/copyTo.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * copyTo
- * 
+ *
  * IN:
  *  args
  *   0 - URL of entry to copy
@@ -33,19 +33,21 @@
  *  fail - FileError
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args, move) {
-    var uri = args[0],
-        destination = args[1],
-        fileName = args[2],
-        copiedEntry;
+    var uri = args[0];
+    var destination = args[1];
+    var fileName = args[2];
+    var copiedEntry;
 
-    function onSuccess() {
+    function onSuccess () {
         resolve(
             function (entry) {
-                if (typeof(success) === 'function') {
+                if (typeof (success) === 'function') {
                     success(entry);
                 }
             },
@@ -53,14 +55,16 @@ module.exports = function (success, fail, args, move) {
             [destination + copiedEntry.name]
         );
     }
-    function onFail(error) {
-        if (typeof(fail) === 'function') {
+    function onFail (error) {
+        if (typeof (fail) === 'function') {
             if (error && error.code) {
-                //set error codes expected by mobile spec
+                // set error codes expected by mobile spec
+                /* eslint-disable no-undef */
                 if (uri === destination) {
                     fail(FileError.INVALID_MODIFICATION_ERR);
                 } else if (error.code === FileError.SECURITY_ERR) {
                     fail(FileError.INVALID_MODIFICATION_ERR);
+                    /* eslint-enable no-undef */
                 } else {
                     fail(error.code);
                 }
@@ -69,13 +73,13 @@ module.exports = function (success, fail, args, move) {
             }
         }
     }
-    function writeFile(fileEntry, blob, entry) {
+    function writeFile (fileEntry, blob, entry) {
         copiedEntry = fileEntry;
         fileEntry.createWriter(function (fileWriter) {
             fileWriter.onwriteend = function () {
                 if (move) {
                     entry.nativeEntry.remove(onSuccess, function () {
-                        console.error("Move operation failed. Files may exist at both source and destination");
+                        console.error('Move operation failed. Files may exist at both source and destination');
                     });
                 } else {
                     onSuccess();
@@ -85,33 +89,35 @@ module.exports = function (success, fail, args, move) {
             fileWriter.write(blob);
         }, onFail);
     }
-    function copyFile(entry) {
+    function copyFile (entry) {
         if (entry.nativeEntry.file) {
             entry.nativeEntry.file(function (file) {
+                /* eslint-disable no-undef */
                 var reader = new FileReader()._realReader;
                 reader.onloadend = function (e) {
-                    var contents = new Uint8Array(this.result),
-                        blob = new Blob([contents]);
+                    var contents = new Uint8Array(this.result);
+                    var blob = new Blob([contents]);
                     resolve(function (destEntry) {
                         requestAnimationFrame(function () {
                             destEntry.nativeEntry.getFile(fileName, {create: true}, function (fileEntry) {
                                 writeFile(fileEntry, blob, entry);
                             }, onFail);
                         });
-                    }, onFail, [destination]);   
+                    }, onFail, [destination]);
                 };
                 reader.onerror = onFail;
                 reader.readAsArrayBuffer(file);
             }, onFail);
         } else {
             onFail(FileError.INVALID_MODIFICATION_ERR);
+            /* eslint-enable no-undef */
         }
     }
-    function copyDirectory(entry) {
+    function copyDirectory (entry) {
         resolve(function (destEntry) {
             if (entry.filesystemName !== destEntry.filesystemName) {
-                console.error("Copying directories between filesystems is not supported on BB10");
-                onFail(FileError.INVALID_MODIFICATION_ERR);
+                console.error('Copying directories between filesystems is not supported on BB10');
+                onFail(FileError.INVALID_MODIFICATION_ERR); // eslint-disable-line no-undef
             } else {
                 entry.nativeEntry.copyTo(destEntry.nativeEntry, fileName, function () {
                     resolve(function (copiedDir) {
@@ -124,13 +130,13 @@ module.exports = function (success, fail, args, move) {
                     }, onFail, [destination + fileName]);
                 }, onFail);
             }
-        }, onFail, [destination]); 
+        }, onFail, [destination]);
     }
 
     if (destination + fileName === uri) {
-        onFail(FileError.INVALID_MODIFICATION_ERR);
+        onFail(FileError.INVALID_MODIFICATION_ERR); // eslint-disable-line no-undef
     } else if (fileName.indexOf(':') > -1) {
-        onFail(FileError.ENCODING_ERR);
+        onFail(FileError.ENCODING_ERR); // eslint-disable-line no-undef
     } else {
         resolve(function (entry) {
             if (entry.isDirectory) {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/createEntryFromNative.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/createEntryFromNative.js b/www/blackberry10/createEntryFromNative.js
index 7202e3a..f70c9d3 100644
--- a/www/blackberry10/createEntryFromNative.js
+++ b/www/blackberry10/createEntryFromNative.js
@@ -21,50 +21,52 @@
 
 /*
  * createEntryFromNative
- * 
+ *
  * IN
  *  native - webkit Entry
  * OUT
  *  returns Cordova entry
  */
 
-var info = require('cordova-plugin-file.bb10FileSystemInfo'),
-    fileSystems = require('cordova-plugin-file.fileSystems');
+var info = require('cordova-plugin-file.bb10FileSystemInfo');
+var fileSystems = require('cordova-plugin-file.fileSystems');
 
 module.exports = function (native) {
     var entry = {
-            nativeEntry: native,
-            isDirectory: !!native.isDirectory,
-            isFile: !!native.isFile,
-            name: native.name,
-            fullPath: native.fullPath,
-            filesystemName: native.filesystem.name,
-            nativeURL: native.toURL()
-        },
-        persistentPath = info.persistentPath.substring(7),
-        temporaryPath = info.temporaryPath.substring(7);
-    //fix bb10 webkit incorrect nativeURL
+        nativeEntry: native,
+        isDirectory: !!native.isDirectory,
+        isFile: !!native.isFile,
+        name: native.name,
+        fullPath: native.fullPath,
+        filesystemName: native.filesystem.name,
+        nativeURL: native.toURL()
+    };
+    var persistentPath = info.persistentPath.substring(7);
+    var temporaryPath = info.temporaryPath.substring(7);
+    // fix bb10 webkit incorrect nativeURL
     if (native.filesystem.name === 'root') {
+        /* eslint-disable no-undef */
         entry.nativeURL = 'file:///' + FileSystem.encodeURIPath(native.fullPath);
     } else if (entry.nativeURL.indexOf('filesystem:local:///persistent/') === 0) {
         entry.nativeURL = info.persistentPath + FileSystem.encodeURIPath(native.fullPath);
     } else if (entry.nativeURL.indexOf('filesystem:local:///temporary') === 0) {
         entry.nativeURL = info.temporaryPath + FileSystem.encodeURIPath(native.fullPath);
     }
-    //translate file system name from bb10 webkit
+    /* eslint-enable no-undef */
+    // translate file system name from bb10 webkit
     if (entry.filesystemName === 'local__0:Persistent' || entry.fullPath.indexOf(persistentPath) !== -1) {
         entry.filesystemName = 'persistent';
     } else if (entry.filesystemName === 'local__0:Temporary' || entry.fullPath.indexOf(temporaryPath) !== -1) {
         entry.filesystemName = 'temporary';
     }
-    //add file system property (will be called sync)
+    // add file system property (will be called sync)
     fileSystems.getFs(entry.filesystemName, function (fs) {
         entry.filesystem = fs;
     });
-    //set root on fullPath for persistent / temporary locations
-    entry.fullPath = entry.fullPath.replace(persistentPath, "");
-    entry.fullPath = entry.fullPath.replace(temporaryPath, "");
-    //set trailing slash on directory
+    // set root on fullPath for persistent / temporary locations
+    entry.fullPath = entry.fullPath.replace(persistentPath, '');
+    entry.fullPath = entry.fullPath.replace(temporaryPath, '');
+    // set trailing slash on directory
     if (entry.isDirectory && entry.fullPath.substring(entry.fullPath.length - 1) !== '/') {
         entry.fullPath += '/';
     }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/getDirectory.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getDirectory.js b/www/blackberry10/getDirectory.js
index 265818c..3f55bca 100644
--- a/www/blackberry10/getDirectory.js
+++ b/www/blackberry10/getDirectory.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * getDirectory
- * 
+ *
  * IN:
  *  args
  *   0 - local filesytem URI for the base directory to search
@@ -31,41 +31,44 @@
  *  success - DirectoryEntry
  *  fail - FileError code
  */
-
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0] === "/" ? "" : args[0],
-        dir = args[1],
-        options = args[2],
-        onSuccess = function (entry) {
-            if (typeof(success) === 'function') {
-                success(entry);
-            }
-        },
-        onFail = function (error) {
-            if (typeof(fail) === 'function') {
-                if (error && error.code) {
-                    //set error codes expected by mobile-spec tests
-                    if (error.code === FileError.INVALID_MODIFICATION_ERR  && options.exclusive) {
-                        fail(FileError.PATH_EXISTS_ERR);
-                    } else if ( error.code === FileError.NOT_FOUND_ERR && dir.indexOf(':') > 0) {
-                        fail(FileError.ENCODING_ERR);
-                    } else {
-                        fail(error.code);
-                    }
+    var uri = args[0] === '/' ? '' : args[0];
+    var dir = args[1];
+    var options = args[2];
+    var onSuccess = function (entry) {
+        if (typeof (success) === 'function') {
+            success(entry);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof (fail) === 'function') {
+            if (error && error.code) {
+                /* eslint-disable no-undef */
+                // set error codes expected by mobile-spec tests
+                if (error.code === FileError.INVALID_MODIFICATION_ERR && options.exclusive) {
+                    fail(FileError.PATH_EXISTS_ERR);
+                } else if (error.code === FileError.NOT_FOUND_ERR && dir.indexOf(':') > 0) {
+                    fail(FileError.ENCODING_ERR);
                 } else {
-                    fail(error);
+                    /* eslint-enable no-undef */
+                    fail(error.code);
                 }
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (entry) {
         requestAnimationFrame(function () {
             entry.nativeEntry.getDirectory(dir, options, function (nativeEntry) {
                 resolve(function (entry) {
                     onSuccess(entry);
-                }, onFail, [uri + "/" + dir]);
+                }, onFail, [uri + '/' + dir]);
             }, onFail);
         });
     }, onFail, [uri]);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/getFile.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getFile.js b/www/blackberry10/getFile.js
index faf130d..74ba07d 100644
--- a/www/blackberry10/getFile.js
+++ b/www/blackberry10/getFile.js
@@ -19,7 +19,7 @@
  *
 */
 
-/* 
+/*
  * getFile
  *
  * IN:
@@ -32,24 +32,24 @@
  *  fail - FileError code
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'); // eslint-disable-line no-undef
 
 module.exports = function (success, fail, args) {
-    var uri = args[0] === "/" ? "" : args[0] + "/" + args[1],
-        options = args[2],
-        onSuccess = function (entry) {
-            if (typeof(success) === 'function') {
-                success(entry);
-            }
-        },
-        onFail = function (code) {
-            if (typeof(fail) === 'function') {
-                fail(code);
-            }
-        };
+    var uri = args[0] === '/' ? '' : args[0] + '/' + args[1];
+    var options = args[2];
+    var onSuccess = function (entry) {
+        if (typeof (success) === 'function') {
+            success(entry);
+        }
+    };
+    var onFail = function (code) {
+        if (typeof (fail) === 'function') {
+            fail(code);
+        }
+    };
     resolve(function (entry) {
         if (!entry.isFile) {
-            onFail(FileError.TYPE_MISMATCH_ERR);
+            onFail(FileError.TYPE_MISMATCH_ERR); // eslint-disable-line no-undef
         } else {
             onSuccess(entry);
         }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/getFileMetadata.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getFileMetadata.js b/www/blackberry10/getFileMetadata.js
index 558a665..a1d4ec9 100644
--- a/www/blackberry10/getFileMetadata.js
+++ b/www/blackberry10/getFileMetadata.js
@@ -19,7 +19,7 @@
  *
 */
 
-/* 
+/*
  * getFileMetadata
  *
  * IN:
@@ -33,26 +33,27 @@
  *   - size
  *  fail - FileError code
  */
-
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        onSuccess = function (entry) {
-            if (typeof(success) === 'function') {
-                success(entry);
-            }
-        },
-        onFail = function (error) {
-            if (typeof(fail) === 'function') {
-                if (error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var onSuccess = function (entry) {
+        if (typeof (success) === 'function') {
+            success(entry);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof (fail) === 'function') {
+            if (error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (entry) {
         requestAnimationFrame(function () {
             if (entry.nativeEntry.file) {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/getMetadata.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getMetadata.js b/www/blackberry10/getMetadata.js
index 649f384..dadfd53 100644
--- a/www/blackberry10/getMetadata.js
+++ b/www/blackberry10/getMetadata.js
@@ -19,7 +19,7 @@
  *
 */
 
-/* 
+/*
  * getMetadata
  *
  * IN:
@@ -30,24 +30,24 @@
  *  fail - FileError code
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'); // eslint-disable-line no-undef
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        onSuccess = function (entry) {
-            if (typeof(success) === 'function') {
-                success(entry);
-            }
-        },
-        onFail = function (error) {
-            if (typeof(fail) === 'function') {
-                if (error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var onSuccess = function (entry) {
+        if (typeof (success) === 'function') {
+            success(entry);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof (fail) === 'function') {
+            if (error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (entry) {
         entry.nativeEntry.getMetadata(onSuccess, onFail);
     }, onFail, [uri]);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/getParent.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getParent.js b/www/blackberry10/getParent.js
index 1eba0a0..63d69a3 100644
--- a/www/blackberry10/getParent.js
+++ b/www/blackberry10/getParent.js
@@ -19,7 +19,7 @@
  *
 */
 
-/* 
+/*
  * getParent
  *
  * IN:
@@ -29,26 +29,27 @@
  *  success - DirectoryEntry of parent
  *  fail - FileError code
  */
-
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* esline-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        onSuccess = function (entry) {
-            if (typeof(success) === 'function') {
-                success(entry);
-            }
-        },
-        onFail = function (error) {
-            if (typeof(fail) === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var onSuccess = function (entry) {
+        if (typeof (success) === 'function') {
+            success(entry);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof (fail) === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (entry) {
         requestAnimationFrame(function () {
             entry.nativeEntry.getParent(onSuccess, onFail);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/info.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/info.js b/www/blackberry10/info.js
index 63f9504..3d9f230 100644
--- a/www/blackberry10/info.js
+++ b/www/blackberry10/info.js
@@ -19,7 +19,7 @@
  *
 */
 
-/* 
+/*
  * info
  *
  * persistentPath - full path to app sandboxed persistent storage
@@ -29,13 +29,13 @@
  */
 
 var info = {
-    persistentPath: "", 
-    temporaryPath: "", 
-    localPath: "",
+    persistentPath: '',
+    temporaryPath: '',
+    localPath: '',
     MAX_SIZE: 64 * 1024 * 1024 * 1024
 };
 
-cordova.exec(
+cordova.exec( // eslint-disable-line no-undef
     function (path) {
         info.persistentPath = 'file://' + path + '/webviews/webfs/persistent/local__0';
         info.temporaryPath = 'file://' + path + '/webviews/webfs/temporary/local__0';

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/moveTo.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/moveTo.js b/www/blackberry10/moveTo.js
index 0ae6810..3ad9fa8 100644
--- a/www/blackberry10/moveTo.js
+++ b/www/blackberry10/moveTo.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * moveTo
- * 
+ *
  * IN:
  *  args
  *   0 - URL of entry to move
@@ -32,7 +32,7 @@
  *  fail - FileError
  */
 
-var copy = cordova.require('cordova-plugin-file.copyToProxy');
+var copy = cordova.require('cordova-plugin-file.copyToProxy'); // eslint-disable-line no-undef
 
 module.exports = function (success, fail, args) {
     copy(success, fail, args, true);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/readAsArrayBuffer.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsArrayBuffer.js b/www/blackberry10/readAsArrayBuffer.js
index 0e21624..fe17978 100644
--- a/www/blackberry10/readAsArrayBuffer.js
+++ b/www/blackberry10/readAsArrayBuffer.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * readAsArrayBuffer
- * 
+ *
  * IN:
  *  args
  *   0 - URL of file to read
@@ -32,36 +32,38 @@
  *  fail - FileError
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        start = args[1],
-        end = args[2],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var start = args[1];
+    var end = args[2];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             fs.nativeEntry.file(function (file) {
-                var reader = new FileReader()._realReader;
+                var reader = new FileReader()._realReader; // eslint-disable-line no-undef
                 reader.onloadend = function () {
                     onSuccess(this.result.slice(start, end));
                 };
                 reader.onerror = onFail;
-                reader.readAsArrayBuffer(file); 
+                reader.readAsArrayBuffer(file);
             }, onFail);
         });
     }, fail, [uri]);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/readAsBinaryString.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsBinaryString.js b/www/blackberry10/readAsBinaryString.js
index 8e40e3f..9069343 100644
--- a/www/blackberry10/readAsBinaryString.js
+++ b/www/blackberry10/readAsBinaryString.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * readAsBinaryString
- * 
+ *
  * IN:
  *  args
  *   0 - URL of file to read
@@ -32,36 +32,38 @@
  *  fail - FileError
  */
 
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        start = args[1],
-        end = args[2],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var start = args[1];
+    var end = args[2];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             fs.nativeEntry.file(function (file) {
-                var reader = new FileReader()._realReader;
+                var reader = new FileReader()._realReader; // eslint-disable-line no-undef
                 reader.onloadend = function () {
                     onSuccess(this.result.substring(start, end));
                 };
                 reader.onerror = onFail;
-                reader.readAsBinaryString(file); 
+                reader.readAsBinaryString(file);
             }, onFail);
         });
     }, fail, [uri]);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/readAsDataURL.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsDataURL.js b/www/blackberry10/readAsDataURL.js
index 786fb63..96147f5 100644
--- a/www/blackberry10/readAsDataURL.js
+++ b/www/blackberry10/readAsDataURL.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * readAsDataURL
- * 
+ *
  * IN:
  *  args
  *   0 - URL of file to read
@@ -30,35 +30,36 @@
  *  fail - FileError
  */
 
-
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             fs.nativeEntry.file(function (file) {
-                var reader = new FileReader()._realReader;
+                var reader = new FileReader()._realReader; // eslint-disable-line no-undef
                 reader.onloadend = function () {
                     onSuccess(this.result);
                 };
                 reader.onerror = onFail;
-                reader.readAsDataURL(file); 
+                reader.readAsDataURL(file);
             }, onFail);
         });
     }, fail, [uri]);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/www/blackberry10/readAsText.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsText.js b/www/blackberry10/readAsText.js
index 74fa420..99bafd3 100644
--- a/www/blackberry10/readAsText.js
+++ b/www/blackberry10/readAsText.js
@@ -19,9 +19,9 @@
  *
 */
 
-/* 
+/*
  * readAsText
- * 
+ *
  * IN:
  *  args
  *   0 - URL of file to read
@@ -33,36 +33,39 @@
  *  fail - FileError
  */
 
-
-var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy'),
-    requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-disable no-undef */
+var resolve = cordova.require('cordova-plugin-file.resolveLocalFileSystemURIProxy');
+var requestAnimationFrame = cordova.require('cordova-plugin-file.bb10RequestAnimationFrame');
+/* eslint-enable no-undef */
 
 module.exports = function (success, fail, args) {
-    var uri = args[0],
-        start = args[2],
-        end = args[3],
-        onSuccess = function (data) {
-            if (typeof success === 'function') {
-                success(data);
-            }
-        },
-        onFail = function (error) {
-            if (typeof fail === 'function') {
-                if (error && error.code) {
-                    fail(error.code);
-                } else {
-                    fail(error);
-                }
+    var uri = args[0];
+    var start = args[2];
+    var end = args[3];
+    var onSuccess = function (data) {
+        if (typeof success === 'function') {
+            success(data);
+        }
+    };
+    var onFail = function (error) {
+        if (typeof fail === 'function') {
+            if (error && error.code) {
+                fail(error.code);
+            } else {
+                fail(error);
             }
-        };
+        }
+    };
     resolve(function (fs) {
         requestAnimationFrame(function () {
             fs.nativeEntry.file(function (file) {
+                /* eslint-disable no-undef */
                 var reader = new FileReader()._realReader;
                 reader.onloadend = function () {
-                    var contents = new Uint8Array(this.result).subarray(start, end),
-                        blob = new Blob([contents]),
-                        textReader = new FileReader()._realReader;
+                    var contents = new Uint8Array(this.result).subarray(start, end);
+                    var blob = new Blob([contents]);
+                    var textReader = new FileReader()._realReader;
+                    /* eslint-enable no-undef */
                     textReader.onloadend = function () {
                         onSuccess(this.result);
                     };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[4/5] cordova-plugin-file git commit: CB-12895 : setup eslint and took out jshint

Posted by au...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/07557e02/src/windows/FileProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/FileProxy.js b/src/windows/FileProxy.js
index fa56a53..d829d77 100644
--- a/src/windows/FileProxy.js
+++ b/src/windows/FileProxy.js
@@ -1,4 +1,4 @@
-/*
+/*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -21,14 +21,14 @@
 
 /* global Windows, WinJS, MSApp */
 
-var File = require('./File'),
-    FileError = require('./FileError'),
-    Flags = require('./Flags'),
-    FileSystem = require('./FileSystem'),
-    LocalFileSystem = require('./LocalFileSystem'),
-    utils = require('cordova/utils');
+var File = require('./File');
+var FileError = require('./FileError');
+var Flags = require('./Flags');
+var FileSystem = require('./FileSystem');
+var LocalFileSystem = require('./LocalFileSystem');
+var utils = require('cordova/utils');
 
-function Entry(isFile, isDirectory, name, fullPath, filesystemName, nativeURL) {
+function Entry (isFile, isDirectory, name, fullPath, filesystemName, nativeURL) {
     this.isFile = !!isFile;
     this.isDirectory = !!isDirectory;
     this.name = name || '';
@@ -37,31 +37,30 @@ function Entry(isFile, isDirectory, name, fullPath, filesystemName, nativeURL) {
     this.nativeURL = nativeURL || null;
 }
 
-var FileEntry = function(name, fullPath, filesystemName, nativeURL) {
-     FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, filesystemName, nativeURL]);
+var FileEntry = function (name, fullPath, filesystemName, nativeURL) {
+    FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, filesystemName, nativeURL]);
 };
 
 utils.extend(FileEntry, Entry);
 
-var DirectoryEntry = function(name, fullPath, filesystemName, nativeURL) {
+var DirectoryEntry = function (name, fullPath, filesystemName, nativeURL) {
     DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, filesystemName, nativeURL);
 };
 
 utils.extend(DirectoryEntry, Entry);
 
-  
 var getFolderFromPathAsync = Windows.Storage.StorageFolder.getFolderFromPathAsync;
 var getFileFromPathAsync = Windows.Storage.StorageFile.getFileFromPathAsync;
 
-function  writeBytesAsync(storageFile, data, position) {
+function writeBytesAsync (storageFile, data, position) {
     return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite)
     .then(function (output) {
         output.seek(position);
         var dataWriter = new Windows.Storage.Streams.DataWriter(output);
         dataWriter.writeBytes(data);
         return dataWriter.storeAsync().then(function (size) {
-            output.size = position+size;
-            return dataWriter.flushAsync().then(function() {
+            output.size = position + size;
+            return dataWriter.flushAsync().then(function () {
                 output.close();
                 return size;
             });
@@ -69,15 +68,15 @@ function  writeBytesAsync(storageFile, data, position) {
     });
 }
 
-function writeTextAsync(storageFile, data, position) {
+function writeTextAsync (storageFile, data, position) {
     return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite)
     .then(function (output) {
         output.seek(position);
         var dataWriter = new Windows.Storage.Streams.DataWriter(output);
         dataWriter.writeString(data);
         return dataWriter.storeAsync().then(function (size) {
-            output.size = position+size;
-            return dataWriter.flushAsync().then(function() {
+            output.size = position + size;
+            return dataWriter.flushAsync().then(function () {
                 output.close();
                 return size;
             });
@@ -85,17 +84,17 @@ function writeTextAsync(storageFile, data, position) {
     });
 }
 
-function writeBlobAsync(storageFile, data, position) {
+function writeBlobAsync (storageFile, data, position) {
     return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite)
     .then(function (output) {
         output.seek(position);
         var dataSize = data.size;
         var input = (data.detachStream || data.msDetachStream).call(data);
 
-        // Copy the stream from the blob to the File stream 
+        // Copy the stream from the blob to the File stream
         return Windows.Storage.Streams.RandomAccessStream.copyAsync(input, output)
         .then(function () {
-			output.size = position+dataSize;
+            output.size = position + dataSize;
             return output.flushAsync().then(function () {
                 input.close();
                 output.close();
@@ -106,11 +105,11 @@ function writeBlobAsync(storageFile, data, position) {
     });
 }
 
-function writeArrayBufferAsync(storageFile, data, position) {
-    return writeBlobAsync(storageFile, new Blob([data]), position);
+function writeArrayBufferAsync (storageFile, data, position) {
+    return writeBlobAsync(storageFile, new Blob([data]), position); // eslint-disable-line no-undef
 }
 
-function cordovaPathToNative(path) {
+function cordovaPathToNative (path) {
     // turn / into \\
     var cleanPath = path.replace(/\//g, '\\');
     // turn  \\ into \
@@ -118,30 +117,30 @@ function cordovaPathToNative(path) {
     return cleanPath;
 }
 
-function nativePathToCordova(path) {
+function nativePathToCordova (path) {
     var cleanPath = path.replace(/\\/g, '/');
     return cleanPath;
 }
 
-var driveRE = new RegExp("^[/]*([A-Z]:)");
+var driveRE = new RegExp('^[/]*([A-Z]:)');
 var invalidNameRE = /[\\?*|"<>:]/;
-function validName(name) {
-    return !invalidNameRE.test(name.replace(driveRE,''));
+function validName (name) {
+    return !invalidNameRE.test(name.replace(driveRE, ''));
 }
 
-function sanitize(path) {
-    var slashesRE = new RegExp('/{2,}','g');
+function sanitize (path) {
+    var slashesRE = new RegExp('/{2,}', 'g');
     var components = path.replace(slashesRE, '/').split(/\/+/);
     // Remove double dots, use old school array iteration instead of RegExp
     // since it is impossible to debug them
     for (var index = 0; index < components.length; ++index) {
-        if (components[index] === "..") {
+        if (components[index] === '..') {
             components.splice(index, 1);
             if (index > 0) {
                 // if we're not in the start of array then remove preceeding path component,
                 // In case if relative path points above the root directory, just ignore double dots
                 // See file.spec.111 should not traverse above above the root directory for test case
-                components.splice(index-1, 1);
+                components.splice(index - 1, 1);
                 --index;
             }
         }
@@ -149,67 +148,66 @@ function sanitize(path) {
     return components.join('/');
 }
 
-var WinFS = function(name, root) {
+var WinFS = function (name, root) {
     this.winpath = root.winpath;
     if (this.winpath && !/\/$/.test(this.winpath)) {
-        this.winpath += "/";
+        this.winpath += '/';
     }
-    this.makeNativeURL = function (path) {        
-        //CB-11848: This RE supposed to match all leading slashes in sanitized path. 
-        //Removing leading slash to avoid duplicating because this.root.nativeURL already has trailing slash
+    this.makeNativeURL = function (path) {
+        // CB-11848: This RE supposed to match all leading slashes in sanitized path.
+        // Removing leading slash to avoid duplicating because this.root.nativeURL already has trailing slash
         var regLeadingSlashes = /^\/*/;
         var sanitizedPath = sanitize(path.replace(':', '%3A')).replace(regLeadingSlashes, '');
         return FileSystem.encodeURIPath(this.root.nativeURL + sanitizedPath);
     };
     root.fullPath = '/';
-    if (!root.nativeURL)
-            root.nativeURL = 'file://'+sanitize(this.winpath + root.fullPath).replace(':','%3A');
+    if (!root.nativeURL) { root.nativeURL = 'file://' + sanitize(this.winpath + root.fullPath).replace(':', '%3A'); }
     WinFS.__super__.constructor.call(this, name, root);
 };
 
 utils.extend(WinFS, FileSystem);
 
-WinFS.prototype.__format__ = function(fullPath) {
-    var path = sanitize('/'+this.name+(fullPath[0]==='/'?'':'/')+FileSystem.encodeURIPath(fullPath));
+WinFS.prototype.__format__ = function (fullPath) {
+    var path = sanitize('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath));
     return 'cdvfile://localhost' + path;
 };
 
 var windowsPaths = {
-    dataDirectory: "ms-appdata:///local/",
-    cacheDirectory: "ms-appdata:///temp/",
-    tempDirectory: "ms-appdata:///temp/",
-    syncedDataDirectory: "ms-appdata:///roaming/",
-    applicationDirectory: "ms-appx:///",
-    applicationStorageDirectory: "ms-appx:///"
+    dataDirectory: 'ms-appdata:///local/',
+    cacheDirectory: 'ms-appdata:///temp/',
+    tempDirectory: 'ms-appdata:///temp/',
+    syncedDataDirectory: 'ms-appdata:///roaming/',
+    applicationDirectory: 'ms-appx:///',
+    applicationStorageDirectory: 'ms-appx:///'
 };
 
-var AllFileSystems; 
+var AllFileSystems;
 
-function getAllFS() {
+function getAllFS () {
     if (!AllFileSystems) {
         AllFileSystems = {
             'persistent':
-            Object.freeze(new WinFS('persistent', { 
-                name: 'persistent', 
+            Object.freeze(new WinFS('persistent', {
+                name: 'persistent',
                 nativeURL: 'ms-appdata:///local',
-                winpath: nativePathToCordova(Windows.Storage.ApplicationData.current.localFolder.path)  
+                winpath: nativePathToCordova(Windows.Storage.ApplicationData.current.localFolder.path)
             })),
             'temporary':
-            Object.freeze(new WinFS('temporary', { 
-                name: 'temporary', 
+            Object.freeze(new WinFS('temporary', {
+                name: 'temporary',
                 nativeURL: 'ms-appdata:///temp',
                 winpath: nativePathToCordova(Windows.Storage.ApplicationData.current.temporaryFolder.path)
             })),
             'application':
-            Object.freeze(new WinFS('application', { 
-                name: 'application', 
+            Object.freeze(new WinFS('application', {
+                name: 'application',
                 nativeURL: 'ms-appx:///',
                 winpath: nativePathToCordova(Windows.ApplicationModel.Package.current.installedLocation.path)
             })),
             'root':
-            Object.freeze(new WinFS('root', { 
-                name: 'root', 
-                //nativeURL: 'file:///'
+            Object.freeze(new WinFS('root', {
+                name: 'root',
+                // nativeURL: 'file:///'
                 winpath: ''
             }))
         };
@@ -217,70 +215,65 @@ function getAllFS() {
     return AllFileSystems;
 }
 
-function getFS(name) {
+function getFS (name) {
     return getAllFS()[name];
 }
 
-FileSystem.prototype.__format__ = function(fullPath) {
+FileSystem.prototype.__format__ = function (fullPath) {
     return getFS(this.name).__format__(fullPath);
 };
 
-require('./fileSystems').getFs = function(name, callback) {
-    setTimeout(function(){callback(getFS(name));});
+require('./fileSystems').getFs = function (name, callback) {
+    setTimeout(function () { callback(getFS(name)); });
 };
 
-function getFilesystemFromPath(path) {
+function getFilesystemFromPath (path) {
     var res;
     var allfs = getAllFS();
-    Object.keys(allfs).some(function(fsn) {
+    Object.keys(allfs).some(function (fsn) {
         var fs = allfs[fsn];
-        if (path.indexOf(fs.winpath) === 0)
-            res = fs;
+        if (path.indexOf(fs.winpath) === 0) { res = fs; }
         return res;
     });
     return res;
 }
 
 var msapplhRE = new RegExp('^ms-appdata://localhost/');
-function pathFromURL(url) {
-    url=url.replace(msapplhRE,'ms-appdata:///');
+function pathFromURL (url) {
+    url = url.replace(msapplhRE, 'ms-appdata:///');
     var path = decodeURIComponent(url);
     // support for file name with parameters
     if (/\?/g.test(path)) {
-        path = String(path).split("?")[0];
+        path = String(path).split('?')[0];
     }
-    if (path.indexOf("file:/")===0) {
-        if (path.indexOf("file://") !== 0) {
-            url = "file:///" + url.substr(6);
+    if (path.indexOf('file:/') === 0) {
+        if (path.indexOf('file://') !== 0) {
+            url = 'file:///' + url.substr(6);
         }
     }
-    
-    ['file://','ms-appdata:///','ms-appx://','cdvfile://localhost/'].every(function(p) {
-        if (path.indexOf(p)!==0)
-            return true;
-        var thirdSlash = path.indexOf("/", p.length);
+
+    ['file://', 'ms-appdata:///', 'ms-appx://', 'cdvfile://localhost/'].every(function (p) {
+        if (path.indexOf(p) !== 0) { return true; }
+        var thirdSlash = path.indexOf('/', p.length);
         if (thirdSlash < 0) {
-            path = "";
+            path = '';
         } else {
             path = sanitize(path.substr(thirdSlash));
         }
     });
-    
-    return path.replace(driveRE,'$1');
+
+    return path.replace(driveRE, '$1');
 }
 
-function getFilesystemFromURL(url) {
-    url=url.replace(msapplhRE,'ms-appdata:///');
+function getFilesystemFromURL (url) {
+    url = url.replace(msapplhRE, 'ms-appdata:///');
     var res;
-    if (url.indexOf("file:/")===0)
-        res = getFilesystemFromPath(pathFromURL(url));
-    else {
+    if (url.indexOf('file:/') === 0) { res = getFilesystemFromPath(pathFromURL(url)); } else {
         var allfs = getAllFS();
-        Object.keys(allfs).every(function(fsn) {
+        Object.keys(allfs).every(function (fsn) {
             var fs = allfs[fsn];
-            if (url.indexOf(fs.root.nativeURL) === 0 || 
-                url.indexOf('cdvfile://localhost/'+fs.name+'/') === 0) 
-            {
+            if (url.indexOf(fs.root.nativeURL) === 0 ||
+                url.indexOf('cdvfile://localhost/' + fs.name + '/') === 0) {
                 res = fs;
                 return false;
             }
@@ -290,11 +283,10 @@ function getFilesystemFromURL(url) {
     return res;
 }
 
-function getFsPathForWinPath(fs, wpath) {
+function getFsPathForWinPath (fs, wpath) {
     var path = nativePathToCordova(wpath);
-    if (path.indexOf(fs.winpath) !== 0)
-        return null;
-    return path.replace(fs.winpath,'/');
+    if (path.indexOf(fs.winpath) !== 0) { return null; }
+    return path.replace(fs.winpath, '/');
 }
 
 var WinError = {
@@ -303,43 +295,38 @@ var WinError = {
     accessDenied: -2147024891
 };
 
-function openPath(path, ops) {
-    ops=ops?ops:{};
-    return new WinJS.Promise(function (complete,failed) {
+function openPath (path, ops) {
+    ops = ops || {};
+    return new WinJS.Promise(function (complete, failed) {
         getFileFromPathAsync(path).done(
-            function(file) {
-                complete({file:file});
+            function (file) {
+                complete({file: file});
             },
-            function(err) {
-                if (err.number != WinError.fileNotFound && err.number != WinError.invalidArgument)
-                    failed(FileError.NOT_READABLE_ERR);
+            function (err) {
+                if (err.number !== WinError.fileNotFound && err.number !== WinError.invalidArgument) { failed(FileError.NOT_READABLE_ERR); }
                 getFolderFromPathAsync(path)
                 .done(
-                    function(dir) {
-                        if (!ops.getContent)
-                            complete({folder:dir});
-                        else
+                    function (dir) {
+                        if (!ops.getContent) { complete({folder: dir}); } else {
                             WinJS.Promise.join({
-                                files:dir.getFilesAsync(),
-                                folders:dir.getFoldersAsync()
+                                files: dir.getFilesAsync(),
+                                folders: dir.getFoldersAsync()
                             }).done(
-                                function(a) {
+                                function (a) {
                                     complete({
-                                        folder:dir,
-                                        files:a.files,
-                                        folders:a.folders
+                                        folder: dir,
+                                        files: a.files,
+                                        folders: a.folders
                                     });
                                 },
-                                function(err) {
+                                function (err) {  // eslint-disable-line handle-callback-err
                                     failed(FileError.NOT_READABLE_ERR);
                                 }
                             );
+                        }
                     },
-                    function(err) {
-                        if (err.number == WinError.fileNotFound || err.number == WinError.invalidArgument)
-                            complete({});
-                        else
-                            failed(FileError.NOT_READABLE_ERR);
+                    function (err) {
+                        if (err.number === WinError.fileNotFound || err.number === WinError.invalidArgument) { complete({}); } else { failed(FileError.NOT_READABLE_ERR); }
                     }
                 );
             }
@@ -347,36 +334,36 @@ function openPath(path, ops) {
     });
 }
 
-function copyFolder(src,dst,name) {
-    name = name?name:src.name;
-    return new WinJS.Promise(function (complete,failed) {
+function copyFolder (src, dst, name) {
+    name = name || src.name;
+    return new WinJS.Promise(function (complete, failed) {
         WinJS.Promise.join({
-            fld:dst.createFolderAsync(name, Windows.Storage.CreationCollisionOption.openIfExists),
-            files:src.getFilesAsync(),
-            folders:src.getFoldersAsync()
+            fld: dst.createFolderAsync(name, Windows.Storage.CreationCollisionOption.openIfExists),
+            files: src.getFilesAsync(),
+            folders: src.getFoldersAsync()
         }).done(
-            function(the) {
+            function (the) {
                 if (!(the.files.length || the.folders.length)) {
                     complete();
                     return;
                 }
                 var todo = the.files.length;
-                var copyfolders = function() {
+                var copyfolders = function () {
                     if (!(todo--)) {
                         complete();
                         return;
                     }
-                    copyFolder(the.folders[todo],dst)
-                    .done(function() { copyfolders(); }, failed);
+                    copyFolder(the.folders[todo], dst)
+                    .done(function () { copyfolders(); }, failed);
                 };
-                var copyfiles = function() {
+                var copyfiles = function () {
                     if (!(todo--)) {
                         todo = the.folders.length;
                         copyfolders();
                         return;
                     }
                     the.files[todo].copyAsync(the.fld)
-                    .done(function() { copyfiles(); }, failed);
+                    .done(function () { copyfiles(); }, failed);
                 };
                 copyfiles();
             },
@@ -385,36 +372,36 @@ function copyFolder(src,dst,name) {
     });
 }
 
-function moveFolder(src,dst,name) {
-    name = name?name:src.name;
-    return new WinJS.Promise(function (complete,failed) {
+function moveFolder (src, dst, name) {
+    name = name || src.name;
+    return new WinJS.Promise(function (complete, failed) {
         WinJS.Promise.join({
             fld: dst.createFolderAsync(name, Windows.Storage.CreationCollisionOption.openIfExists),
             files: src.getFilesAsync(),
             folders: src.getFoldersAsync()
         }).done(
-            function(the) {
+            function (the) {
                 if (!(the.files.length || the.folders.length)) {
                     complete();
                     return;
                 }
                 var todo = the.files.length;
-                var movefolders = function() {
+                var movefolders = function () {
                     if (!(todo--)) {
-                        src.deleteAsync().done(complete,failed);
+                        src.deleteAsync().done(complete, failed);
                         return;
                     }
                     moveFolder(the.folders[todo], the.fld)
-                    .done(movefolders,failed);
+                    .done(movefolders, failed);
                 };
-                var movefiles = function() {
+                var movefiles = function () {
                     if (!(todo--)) {
                         todo = the.folders.length;
                         movefolders();
                         return;
                     }
                     the.files[todo].moveAsync(the.fld)
-                    .done(function() { movefiles(); }, failed);
+                    .done(function () { movefiles(); }, failed);
                 };
                 movefiles();
             },
@@ -423,7 +410,7 @@ function moveFolder(src,dst,name) {
     });
 }
 
-function transport(success, fail, args, ops) { // ["fullPath","parent", "newName"]
+function transport (success, fail, args, ops) { // ["fullPath","parent", "newName"]
     var src = args[0];
     var parent = args[1];
     var name = args[2];
@@ -432,25 +419,24 @@ function transport(success, fail, args, ops) { // ["fullPath","parent", "newName
     var dstFS = getFilesystemFromURL(parent);
     var srcPath = pathFromURL(src);
     var dstPath = pathFromURL(parent);
-    if (!(srcFS && dstFS && validName(name))){
+    if (!(srcFS && dstFS && validName(name))) {
         fail(FileError.ENCODING_ERR);
         return;
     }
-    
+
     var srcWinPath = cordovaPathToNative(sanitize(srcFS.winpath + srcPath));
     var dstWinPath = cordovaPathToNative(sanitize(dstFS.winpath + dstPath));
-    var tgtFsPath = sanitize(dstPath+'/'+name);
-    var tgtWinPath = cordovaPathToNative(sanitize(dstFS.winpath + dstPath+'/'+name));
-    if (srcWinPath == dstWinPath || srcWinPath == tgtWinPath) {
+    var tgtFsPath = sanitize(dstPath + '/' + name);
+    var tgtWinPath = cordovaPathToNative(sanitize(dstFS.winpath + dstPath + '/' + name));
+    if (srcWinPath === dstWinPath || srcWinPath === tgtWinPath) {
         fail(FileError.INVALID_MODIFICATION_ERR);
         return;
     }
-    
-    
+
     WinJS.Promise.join({
-        src:openPath(srcWinPath),
-        dst:openPath(dstWinPath),
-        tgt:openPath(tgtWinPath,{getContent:true})
+        src: openPath(srcWinPath),
+        dst: openPath(dstWinPath),
+        tgt: openPath(tgtWinPath, {getContent: true})
     })
     .done(
         function (the) {
@@ -464,8 +450,8 @@ function transport(success, fail, args, ops) { // ["fullPath","parent", "newName
                 fail(FileError.INVALID_MODIFICATION_ERR);
                 return;
             }
-            if (the.src.file)
-                ops.fileOp(the.src.file,the.dst.folder, name, Windows.Storage.NameCollisionOption.replaceExisting)
+            if (the.src.file) {
+                ops.fileOp(the.src.file, the.dst.folder, name, Windows.Storage.NameCollisionOption.replaceExisting)
                 .done(
                     function (storageFile) {
                         success(new FileEntry(
@@ -475,36 +461,37 @@ function transport(success, fail, args, ops) { // ["fullPath","parent", "newName
                             dstFS.makeNativeURL(tgtFsPath)
                         ));
                     },
-                    function (err) {
+                    function (err) {  // eslint-disable-line handle-callback-err
                         fail(FileError.INVALID_MODIFICATION_ERR);
                     }
                 );
-            else
+            } else {
                 ops.folderOp(the.src.folder, the.dst.folder, name).done(
                     function () {
                         success(new DirectoryEntry(
-                            name, 
-                            tgtFsPath, 
-                            dstFS.name, 
+                            name,
+                            tgtFsPath,
+                            dstFS.name,
                             dstFS.makeNativeURL(tgtFsPath)
                         ));
                     },
-                    function() {
+                    function () {
                         fail(FileError.INVALID_MODIFICATION_ERR);
                     }
                 );
+            }
         },
-        function(err) {
+        function (err) {  // eslint-disable-line handle-callback-err
             fail(FileError.INVALID_MODIFICATION_ERR);
         }
     );
 }
 
 module.exports = {
-    requestAllFileSystems: function() {
+    requestAllFileSystems: function () {
         return getAllFS();
     },
-    requestAllPaths: function(success){
+    requestAllPaths: function (success) {
         success(windowsPaths);
     },
     getFileMetadata: function (success, fail, args) {
@@ -514,7 +501,7 @@ module.exports = {
     getMetadata: function (success, fail, args) {
         var fs = getFilesystemFromURL(args[0]);
         var path = pathFromURL(args[0]);
-        if (!fs || !validName(path)){
+        if (!fs || !validName(path)) {
             fail(FileError.ENCODING_ERR);
             return;
         }
@@ -525,8 +512,8 @@ module.exports = {
                 function (basicProperties) {
                     success(new File(storageFile.name, storageFile.path, storageFile.fileType, basicProperties.dateModified, basicProperties.size));
                 }, function () {
-                    fail(FileError.NOT_READABLE_ERR);
-                }
+                fail(FileError.NOT_READABLE_ERR);
+            }
             );
         };
 
@@ -559,7 +546,7 @@ module.exports = {
     getParent: function (win, fail, args) { // ["fullPath"]
         var fs = getFilesystemFromURL(args[0]);
         var path = pathFromURL(args[0]);
-        if (!fs || !validName(path)){
+        if (!fs || !validName(path)) {
             fail(FileError.ENCODING_ERR);
             return;
         }
@@ -567,11 +554,11 @@ module.exports = {
             win(new DirectoryEntry(fs.root.name, fs.root.fullPath, fs.name, fs.makeNativeURL(fs.root.fullPath)));
             return;
         }
-        
-        var parpath = path.replace(new RegExp('/[^/]+/?$','g'),'');
+
+        var parpath = path.replace(new RegExp('/[^/]+/?$', 'g'), '');
         var parname = path.substr(parpath.length);
         var fullPath = cordovaPathToNative(fs.winpath + parpath);
-        
+
         var result = new DirectoryEntry(parname, parpath, fs.name, fs.makeNativeURL(parpath));
         getFolderFromPathAsync(fullPath).done(
             function () { win(result); },
@@ -581,57 +568,56 @@ module.exports = {
 
     readAsText: function (win, fail, args) {
 
-        var url = args[0],
-            enc = args[1],
-            startPos = args[2],
-            endPos = args[3];
-        
+        var url = args[0];
+        var enc = args[1];
+        var startPos = args[2];
+        var endPos = args[3];
+
         var fs = getFilesystemFromURL(url);
         var path = pathFromURL(url);
-        if (!fs){
+        if (!fs) {
             fail(FileError.ENCODING_ERR);
             return;
         }
         var wpath = cordovaPathToNative(sanitize(fs.winpath + path));
-        
+
         var encoding = Windows.Storage.Streams.UnicodeEncoding.utf8;
-        if (enc == 'Utf16LE' || enc == 'utf16LE') {
+        if (enc === 'Utf16LE' || enc === 'utf16LE') {
             encoding = Windows.Storage.Streams.UnicodeEncoding.utf16LE;
-        } else if (enc == 'Utf16BE' || enc == 'utf16BE') {
+        } else if (enc === 'Utf16BE' || enc === 'utf16BE') {
             encoding = Windows.Storage.Streams.UnicodeEncoding.utf16BE;
         }
 
-        getFileFromPathAsync(wpath).then(function(file) {
-                return file.openReadAsync();
-            }).then(function (stream) {
-                startPos = (startPos < 0) ? Math.max(stream.size + startPos, 0) : Math.min(stream.size, startPos);
-                endPos = (endPos < 0) ? Math.max(endPos + stream.size, 0) : Math.min(stream.size, endPos);
-                stream.seek(startPos);
-                
-                var readSize = endPos - startPos,
-                    buffer = new Windows.Storage.Streams.Buffer(readSize);
-
-                return stream.readAsync(buffer, readSize, Windows.Storage.Streams.InputStreamOptions.none);
-            }).done(function(buffer) {
-            	try {
-            		win(Windows.Security.Cryptography.CryptographicBuffer.convertBinaryToString(encoding, buffer));
-                }
-                catch (e) {
-                	fail(FileError.ENCODING_ERR);
-                }
-            },function() {
-                fail(FileError.NOT_FOUND_ERR);
-            });
+        getFileFromPathAsync(wpath).then(function (file) {
+            return file.openReadAsync();
+        }).then(function (stream) {
+            startPos = (startPos < 0) ? Math.max(stream.size + startPos, 0) : Math.min(stream.size, startPos);
+            endPos = (endPos < 0) ? Math.max(endPos + stream.size, 0) : Math.min(stream.size, endPos);
+            stream.seek(startPos);
+
+            var readSize = endPos - startPos;
+            var buffer = new Windows.Storage.Streams.Buffer(readSize);
+
+            return stream.readAsync(buffer, readSize, Windows.Storage.Streams.InputStreamOptions.none);
+        }).done(function (buffer) {
+            try {
+                win(Windows.Security.Cryptography.CryptographicBuffer.convertBinaryToString(encoding, buffer));
+            } catch (e) {
+                fail(FileError.ENCODING_ERR);
+            }
+        }, function () {
+            fail(FileError.NOT_FOUND_ERR);
+        });
     },
 
-    readAsBinaryString:function(win,fail,args) {
-        var url = args[0],
-            startPos = args[1],
-            endPos = args[2];
+    readAsBinaryString: function (win, fail, args) {
+        var url = args[0];
+        var startPos = args[1];
+        var endPos = args[2];
 
         var fs = getFilesystemFromURL(url);
         var path = pathFromURL(url);
-        if (!fs){
+        if (!fs) {
             fail(FileError.ENCODING_ERR);
             return;
         }
@@ -643,8 +629,8 @@ module.exports = {
                     function (buffer) {
                         var dataReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer);
                         // var fileContent = dataReader.readString(buffer.length);
-                        var byteArray = new Uint8Array(buffer.length),
-                            byteString = "";
+                        var byteArray = new Uint8Array(buffer.length);
+                        var byteString = '';
                         dataReader.readBytes(byteArray);
                         dataReader.close();
                         for (var i = 0; i < byteArray.length; i++) {
@@ -657,16 +643,16 @@ module.exports = {
                     }
                 );
             }, function () {
-                fail(FileError.NOT_FOUND_ERR);
-            }
+            fail(FileError.NOT_FOUND_ERR);
+        }
         );
     },
 
-    readAsArrayBuffer:function(win,fail,args) {
+    readAsArrayBuffer: function (win, fail, args) {
         var url = args[0];
         var fs = getFilesystemFromURL(url);
         var path = pathFromURL(url);
-        if (!fs){
+        if (!fs) {
             fail(FileError.ENCODING_ERR);
             return;
         }
@@ -675,26 +661,26 @@ module.exports = {
         getFileFromPathAsync(wpath).then(
             function (storageFile) {
                 var blob = MSApp.createFileFromStorageFile(storageFile);
-                var url = URL.createObjectURL(blob, { oneTimeOnly: true });
-                var xhr = new XMLHttpRequest();
-                xhr.open("GET", url, true);
+                var url = URL.createObjectURL(blob, { oneTimeOnly: true }); // eslint-disable-line no-undef
+                var xhr = new XMLHttpRequest(); // eslint-disable-line no-undef
+                xhr.open('GET', url, true);
                 xhr.responseType = 'arraybuffer';
                 xhr.onload = function () {
                     var resultArrayBuffer = xhr.response;
                     // get start and end position of bytes in buffer to be returned
-                    var startPos = args[1] || 0,
-                        endPos = args[2] || resultArrayBuffer.length;
+                    var startPos = args[1] || 0;
+                    var endPos = args[2] || resultArrayBuffer.length;
                     // if any of them is specified, we'll slice output array
                     if (startPos !== 0 || endPos !== resultArrayBuffer.length) {
-                        // slice method supported only on Windows 8.1, so we need to check if it's available 
+                        // slice method supported only on Windows 8.1, so we need to check if it's available
                         // see http://msdn.microsoft.com/en-us/library/ie/dn641192(v=vs.94).aspx
                         if (resultArrayBuffer.slice) {
                             resultArrayBuffer = resultArrayBuffer.slice(startPos, endPos);
                         } else {
                             // if slice isn't available, we'll use workaround method
-                            var tempArray = new Uint8Array(resultArrayBuffer),
-                                resBuffer = new ArrayBuffer(endPos - startPos),
-                                resArray = new Uint8Array(resBuffer);
+                            var tempArray = new Uint8Array(resultArrayBuffer);
+                            var resBuffer = new ArrayBuffer(endPos - startPos);
+                            var resArray = new Uint8Array(resBuffer);
 
                             for (var i = 0; i < resArray.length; i++) {
                                 resArray[i] = tempArray[i + startPos];
@@ -706,8 +692,8 @@ module.exports = {
                 };
                 xhr.send();
             }, function () {
-                fail(FileError.NOT_FOUND_ERR);
-            }
+            fail(FileError.NOT_FOUND_ERR);
+        }
         );
     },
 
@@ -715,7 +701,7 @@ module.exports = {
         var url = args[0];
         var fs = getFilesystemFromURL(url);
         var path = pathFromURL(url);
-        if (!fs){
+        if (!fs) {
             fail(FileError.ENCODING_ERR);
             return;
         }
@@ -726,18 +712,18 @@ module.exports = {
                 Windows.Storage.FileIO.readBufferAsync(storageFile).done(
                     function (buffer) {
                         var strBase64 = Windows.Security.Cryptography.CryptographicBuffer.encodeToBase64String(buffer);
-                        //the method encodeToBase64String will add "77u/" as a prefix, so we should remove it
-                        if(String(strBase64).substr(0,4) == "77u/") {
+                        // the method encodeToBase64String will add "77u/" as a prefix, so we should remove it
+                        if (String(strBase64).substr(0, 4) === '77u/') {
                             strBase64 = strBase64.substr(4);
                         }
                         var mediaType = storageFile.contentType;
-                        var result = "data:" + mediaType + ";base64," + strBase64;
+                        var result = 'data:' + mediaType + ';base64,' + strBase64;
                         win(result);
                     }
                 );
             }, function () {
-                fail(FileError.NOT_FOUND_ERR);
-            }
+            fail(FileError.NOT_FOUND_ERR);
+        }
         );
     },
 
@@ -748,18 +734,18 @@ module.exports = {
 
         var fs = getFilesystemFromURL(dirurl);
         var dirpath = pathFromURL(dirurl);
-        if (!fs || !validName(path)){
+        if (!fs || !validName(path)) {
             fail(FileError.ENCODING_ERR);
             return;
-        }           
-        var fspath = sanitize(dirpath +'/'+ path);
+        }
+        var fspath = sanitize(dirpath + '/' + path);
         var completePath = sanitize(fs.winpath + fspath);
 
-        var name = completePath.substring(completePath.lastIndexOf('/')+1);
-        
+        var name = completePath.substring(completePath.lastIndexOf('/') + 1);
+
         var wpath = cordovaPathToNative(completePath.substring(0, completePath.lastIndexOf('/')));
 
-        var flag = "";
+        var flag = '';
         if (options) {
             flag = new Flags(options.create, options.exclusive);
         } else {
@@ -772,51 +758,51 @@ module.exports = {
                     storageFolder.createFolderAsync(name, Windows.Storage.CreationCollisionOption.failIfExists).done(
                         function (storageFolder) {
                             win(new DirectoryEntry(storageFolder.name, fspath, fs.name, fs.makeNativeURL(fspath)));
-                        }, function (err) {
-                            fail(FileError.PATH_EXISTS_ERR);
-                        }
+                        }, function (err) {  // eslint-disable-line handle-callback-err
+                        fail(FileError.PATH_EXISTS_ERR);
+                    }
                     );
                 } else if (flag.create === true && flag.exclusive === false) {
                     storageFolder.createFolderAsync(name, Windows.Storage.CreationCollisionOption.openIfExists).done(
                         function (storageFolder) {
                             win(new DirectoryEntry(storageFolder.name, fspath, fs.name, fs.makeNativeURL(fspath)));
                         }, function () {
-                            fail(FileError.INVALID_MODIFICATION_ERR);
-                        }
+                        fail(FileError.INVALID_MODIFICATION_ERR);
+                    }
                     );
                 } else if (flag.create === false) {
                     storageFolder.getFolderAsync(name).done(
                         function (storageFolder) {
                             win(new DirectoryEntry(storageFolder.name, fspath, fs.name, fs.makeNativeURL(fspath)));
-                        }, 
+                        },
                         function () {
                             // check if path actually points to a file
                             storageFolder.getFileAsync(name).done(
                                 function () {
                                     fail(FileError.TYPE_MISMATCH_ERR);
-                                }, function() {
-                                    fail(FileError.NOT_FOUND_ERR);
-                                }
+                                }, function () {
+                                fail(FileError.NOT_FOUND_ERR);
+                            }
                             );
                         }
                     );
                 }
             }, function () {
-                fail(FileError.NOT_FOUND_ERR);
-            }
+            fail(FileError.NOT_FOUND_ERR);
+        }
         );
     },
 
     remove: function (win, fail, args) {
         var fs = getFilesystemFromURL(args[0]);
         var path = pathFromURL(args[0]);
-        if (!fs || !validName(path)){
+        if (!fs || !validName(path)) {
             fail(FileError.ENCODING_ERR);
             return;
         }
 
         // FileSystem root can't be removed!
-        if (!path || path=='/'){
+        if (!path || path === '/') {
             fail(FileError.NO_MODIFICATION_ALLOWED_ERR);
             return;
         }
@@ -824,8 +810,8 @@ module.exports = {
 
         getFileFromPathAsync(fullPath).then(
             function (storageFile) {
-                    storageFile.deleteAsync().done(win, function () {
-                        fail(FileError.INVALID_MODIFICATION_ERR);
+                storageFile.deleteAsync().done(win, function () {
+                    fail(FileError.INVALID_MODIFICATION_ERR);
                 });
             },
             function () {
@@ -833,7 +819,7 @@ module.exports = {
                     function (sFolder) {
                         sFolder.getFilesAsync()
                         // check for files
-                        .then(function(fileList) {
+                        .then(function (fileList) {
                             if (fileList) {
                                 if (fileList.length === 0) {
                                     return sFolder.getFoldersAsync();
@@ -847,7 +833,7 @@ module.exports = {
                             if (folderList) {
                                 if (folderList.length === 0) {
                                     sFolder.deleteAsync().done(
-                                        win, 
+                                        win,
                                         function () {
                                             fail(FileError.INVALID_MODIFICATION_ERR);
                                         }
@@ -857,7 +843,7 @@ module.exports = {
                                 }
                             }
                         });
-                    }, 
+                    },
                     function () {
                         fail(FileError.NOT_FOUND_ERR);
                     }
@@ -870,13 +856,13 @@ module.exports = {
 
         var fs = getFilesystemFromURL(args[0]);
         var path = pathFromURL(args[0]);
-        if (!fs || !validName(path)){
+        if (!fs || !validName(path)) {
             fail(FileError.ENCODING_ERR);
             return;
         }
 
         // FileSystem root can't be removed!
-        if (!path || path=='/'){
+        if (!path || path === '/') {
             fail(FileError.NO_MODIFICATION_ALLOWED_ERR);
             return;
         }
@@ -902,18 +888,18 @@ module.exports = {
 
         var fs = getFilesystemFromURL(dirurl);
         var dirpath = pathFromURL(dirurl);
-        if (!fs || !validName(path)){
+        if (!fs || !validName(path)) {
             fail(FileError.ENCODING_ERR);
             return;
         }
-        var fspath = sanitize(dirpath +'/'+ path);
+        var fspath = sanitize(dirpath + '/' + path);
         var completePath = sanitize(fs.winpath + fspath);
 
-        var fileName = completePath.substring(completePath.lastIndexOf('/')+1);
-        
+        var fileName = completePath.substring(completePath.lastIndexOf('/') + 1);
+
         var wpath = cordovaPathToNative(completePath.substring(0, completePath.lastIndexOf('/')));
 
-        var flag = "";
+        var flag = '';
         if (options !== null) {
             flag = new Flags(options.create, options.exclusive);
         } else {
@@ -927,16 +913,16 @@ module.exports = {
                         function (storageFile) {
                             win(new FileEntry(storageFile.name, fspath, fs.name, fs.makeNativeURL(fspath)));
                         }, function () {
-                            fail(FileError.PATH_EXISTS_ERR);
-                        }
+                        fail(FileError.PATH_EXISTS_ERR);
+                    }
                     );
                 } else if (flag.create === true && flag.exclusive === false) {
                     storageFolder.createFileAsync(fileName, Windows.Storage.CreationCollisionOption.openIfExists).done(
                         function (storageFile) {
                             win(new FileEntry(storageFile.name, fspath, fs.name, fs.makeNativeURL(fspath)));
                         }, function () {
-                            fail(FileError.INVALID_MODIFICATION_ERR);
-                        }
+                        fail(FileError.INVALID_MODIFICATION_ERR);
+                    }
                     );
                 } else if (flag.create === false) {
                     storageFolder.getFileAsync(fileName).done(
@@ -944,29 +930,29 @@ module.exports = {
                             win(new FileEntry(storageFile.name, fspath, fs.name, fs.makeNativeURL(fspath)));
                         }, function () {
                             // check if path actually points to a folder
-                            storageFolder.getFolderAsync(fileName).done(
+                        storageFolder.getFolderAsync(fileName).done(
                                 function () {
                                     fail(FileError.TYPE_MISMATCH_ERR);
                                 }, function () {
-                                    fail(FileError.NOT_FOUND_ERR);
-                                });
-                        }
+                            fail(FileError.NOT_FOUND_ERR);
+                        });
+                    }
                     );
                 }
             }, function (err) {
-                fail(
-                    err.number == WinError.accessDenied?
-                    FileError.SECURITY_ERR:
+            fail(
+                    err.number === WinError.accessDenied ?
+                    FileError.SECURITY_ERR :
                     FileError.NOT_FOUND_ERR
                 );
-            }
+        }
         );
     },
 
     readEntries: function (win, fail, args) { // ["fullPath"]
         var fs = getFilesystemFromURL(args[0]);
         var path = pathFromURL(args[0]);
-        if (!fs || !validName(path)){
+        if (!fs || !validName(path)) {
             fail(FileError.ENCODING_ERR);
             return;
         }
@@ -1010,25 +996,25 @@ module.exports = {
 
     write: function (win, fail, args) {
 
-        var url = args[0],
-            data = args[1],
-            position = args[2],
-            isBinary = args[3];
+        var url = args[0];
+        var data = args[1];
+        var position = args[2];
+        var isBinary = args[3];
 
         var fs = getFilesystemFromURL(url);
         var path = pathFromURL(url);
-        if (!fs){
+        if (!fs) {
             fail(FileError.ENCODING_ERR);
             return;
         }
         var completePath = sanitize(fs.winpath + path);
-        var fileName = completePath.substring(completePath.lastIndexOf('/')+1);
-        var dirpath = completePath.substring(0,completePath.lastIndexOf('/'));
+        var fileName = completePath.substring(completePath.lastIndexOf('/') + 1);
+        var dirpath = completePath.substring(0, completePath.lastIndexOf('/'));
         var wpath = cordovaPathToNative(dirpath);
-        
-        function getWriteMethodForData(data, isBinary) {
-            
-            if (data instanceof Blob) {
+
+        function getWriteMethodForData (data, isBinary) {
+
+            if (data instanceof Blob) {  // eslint-disable-line no-undef
                 return writeBlobAsync;
             }
 
@@ -1044,7 +1030,7 @@ module.exports = {
                 return writeTextAsync;
             }
 
-            throw new Error('Unsupported data type for write method');          
+            throw new Error('Unsupported data type for write method');
         }
 
         var writePromise = getWriteMethodForData(data, isBinary);
@@ -1078,19 +1064,19 @@ module.exports = {
     truncate: function (win, fail, args) { // ["fileName","size"]
         var url = args[0];
         var size = args[1];
-        
+
         var fs = getFilesystemFromURL(url);
         var path = pathFromURL(url);
-        if (!fs){
+        if (!fs) {
             fail(FileError.ENCODING_ERR);
             return;
         }
         var completePath = sanitize(fs.winpath + path);
         var wpath = cordovaPathToNative(completePath);
-        var dirwpath = cordovaPathToNative(completePath.substring(0,completePath.lastIndexOf('/')));
+        var dirwpath = cordovaPathToNative(completePath.substring(0, completePath.lastIndexOf('/')));
 
-        getFileFromPathAsync(wpath).done(function(storageFile){
-            //the current length of the file.
+        getFileFromPathAsync(wpath).done(function (storageFile) {
+            // the current length of the file.
             var leng = 0;
 
             storageFile.getBasicPropertiesAsync().then(function (basicProperties) {
@@ -1112,7 +1098,7 @@ module.exports = {
                                 }, function () {
                                     fail(FileError.NO_MODIFICATION_ALLOWED_ERR);
                                 });
-                            }, function() {
+                            }, function () {
                                 fail(FileError.NO_MODIFICATION_ALLOWED_ERR);
                             });
                         });
@@ -1125,29 +1111,29 @@ module.exports = {
     copyTo: function (success, fail, args) { // ["fullPath","parent", "newName"]
         transport(success, fail, args,
             {
-                fileOp:function(file,folder,name,coll) {
-                    return file.copyAsync(folder,name,coll);
+                fileOp: function (file, folder, name, coll) {
+                    return file.copyAsync(folder, name, coll);
                 },
-                folderOp:function(src,dst,name) {
-                    return copyFolder(src,dst,name);
-            }}
+                folderOp: function (src, dst, name) {
+                    return copyFolder(src, dst, name);
+                }}
         );
     },
 
     moveTo: function (success, fail, args) {
         transport(success, fail, args,
             {
-                fileOp:function(file,folder,name,coll) {
-                    return file.moveAsync(folder,name,coll);
+                fileOp: function (file, folder, name, coll) {
+                    return file.moveAsync(folder, name, coll);
                 },
-                folderOp:function(src,dst,name) {
-                    return moveFolder(src,dst,name);
-            }}
+                folderOp: function (src, dst, name) {
+                    return moveFolder(src, dst, name);
+                }}
         );
     },
-    tempFileSystem:null,
+    tempFileSystem: null,
 
-    persistentFileSystem:null,
+    persistentFileSystem: null,
 
     requestFileSystem: function (win, fail, args) {
 
@@ -1158,20 +1144,17 @@ module.exports = {
             fail(FileError.QUOTA_EXCEEDED_ERR);
             return;
         }
-        
+
         var fs;
         switch (type) {
-            case LocalFileSystem.TEMPORARY:
-                fs = getFS('temporary');
-                break;
-            case LocalFileSystem.PERSISTENT:
-                fs = getFS('persistent');
-                break;
+        case LocalFileSystem.TEMPORARY:
+            fs = getFS('temporary');
+            break;
+        case LocalFileSystem.PERSISTENT:
+            fs = getFS('persistent');
+            break;
         }
-        if (fs)
-            win(fs);
-        else
-            fail(FileError.NOT_FOUND_ERR);
+        if (fs) { win(fs); } else { fail(FileError.NOT_FOUND_ERR); }
     },
 
     resolveLocalFileSystemURI: function (success, fail, args) {
@@ -1184,26 +1167,24 @@ module.exports = {
             fail(FileError.ENCODING_ERR);
             return;
         }
-        if (path.indexOf(fs.winpath) === 0)
-            path=path.substr(fs.winpath.length);
-        var abspath = cordovaPathToNative(fs.winpath+path);
-        
+        if (path.indexOf(fs.winpath) === 0) { path = path.substr(fs.winpath.length); }
+        var abspath = cordovaPathToNative(fs.winpath + path);
+
         getFileFromPathAsync(abspath).done(
             function (storageFile) {
                 success(new FileEntry(storageFile.name, path, fs.name, fs.makeNativeURL(path)));
             }, function () {
-                getFolderFromPathAsync(abspath).done(
+            getFolderFromPathAsync(abspath).done(
                     function (storageFolder) {
-                        success(new DirectoryEntry(storageFolder.name, path, fs.name,fs.makeNativeURL(path)));
+                        success(new DirectoryEntry(storageFolder.name, path, fs.name, fs.makeNativeURL(path)));
                     }, function () {
-                        fail(FileError.NOT_FOUND_ERR);
-                    }
-                );
+                fail(FileError.NOT_FOUND_ERR);
             }
+                );
+        }
         );
     }
-    
 
 };
 
-require("cordova/exec/proxy").add("File",module.exports);
+require('cordova/exec/proxy').add('File', module.exports);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org