I am developing an app using ionic framework. In it i am integrating Parse server API. but when i am running my application i am facing following problem -
Linting www/js/parse.js
Errors in file www/js/parse.js
9212:1 -> Unreachable '(' after 'return'. -> (function() {
9265:2 -> Read only. -> exports = module.exports = _;
But parse.js is a SDK file and i can't make any change in it.
Could any one explain me whats wrong with this?
Thanks in advance!
I think you have downloaded and saved parse.js
manually to your project. It would be better to manage external libraries with bower
. For example to install this library execute the next from your project root:
bower install parse-sdk
This will install parse-sdk
library in the www/lib
directory. To add this project dependency to your bower manager, add --save
to end of the command and it will be saved in the bower.json
.
Within the index.html
include the parse.js
from the www/lib/parse-js-sdk
location.
Now the linting that is part of your hooks
directory will not process any files in the www/lib
directory.
If you still want to do it manually like you did, save all libraries outside the www/js
directory to avoid the linting. Also consider to include the minified version of the JS file to speed things up.
I recommand to add all vendors
lib into www/lib directory.
I personnaly then do not had the vendor directory to the jshint tests.
This is configured into the hooks/before_prepare/02_jshint.js
into variable :
var foldersToProcess = [];
As you have definied the js dir to be parsed for jshint and added the vendor lib in it, it is processed.