diff --git a/.jshintignore b/.jshintignore index f05b1f26..3c3629e6 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,2 +1 @@ node_modules -test diff --git a/.jshintrc b/.jshintrc index d0ace6ce..b9e97cde 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,11 @@ { + "curly": true, + "eqeqeq": true, + "nonew": true, + "noarg": true, + "forin": true, + "futurehostile": true, + "freeze": true, "undef": true, "strict": true, "sub": true, diff --git a/Gruntfile.js b/Gruntfile.js index 1c79c178..36ef96c4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -107,11 +107,27 @@ module.exports = function(grunt) { } }, jshint: { - options: { - jshintrc: "./.jshintrc" - }, - all: ['./lib/**/*.js', './test/helpers/**/*.js', './test/asserts/**/*.js'] - }, + // see https://github.com/gruntjs/grunt-contrib-jshint/issues/198 + // we can't override the options using the jshintrc path + options: grunt.file.readJSON('.jshintrc'), + production: ['./lib/**/*.js'], + test: ['./test/helpers/**/*.js', './test/asserts/**/*.js'], + documentation: { + options: { + globals: { + jQuery: false, + JSZip: false, + JSZipUtils: false, + saveAs: false + }, + // implied still give false positives in our case + strict: false + }, + files: { + src: ['./documentation/**/*.js'] + } + } + }, browserify: { all: { files: { diff --git a/documentation/api_jszip/external.md b/documentation/api_jszip/external.md index eca01810..c0ce2381 100644 --- a/documentation/api_jszip/external.md +++ b/documentation/api_jszip/external.md @@ -6,7 +6,17 @@ section: api JSZip uses polyfills of objects that may not exist on every platform. Accessing or replacing these objects can sometimes be useful. JSZip.external -It contains the following properties : +contains the following properties : -* `Promise` : the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) used. +* `Promise` : the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) implementation used. + +__Example__ + +```js +// use bluebird instead +JSZip.external.Promise = Bluebird; + +// use the native Promise object: +JSZip.external.Promise = Promise; +``` diff --git a/documentation/api_jszip/file_data.md b/documentation/api_jszip/file_data.md index 352c71ba..2aa30544 100644 --- a/documentation/api_jszip/file_data.md +++ b/documentation/api_jszip/file_data.md @@ -11,7 +11,7 @@ __Arguments__ name | type | description --------------------|---------|------------ name | string | the name of the file. You can specify folders in the name : the folder separator is a forward slash ("/"). -data | String/ArrayBuffer/Uint8Array/Buffer | the content of the file. +data | String/ArrayBuffer/Uint8Array/Buffer/Blob/Promise | the content of the file. options | object | the options. Content of `options` : @@ -51,7 +51,8 @@ as a folder and the content will be ignored. __Returns__ : The current JSZip object, for chaining. -__Throws__ : An exception if the data is not in a supported format. +__Throws__ : Nothing. (an exception will be propagated if the data is not in +a supported format).