add sourceType config option

Valid values are `module` (default) and `script`. Using `script` will suppress implied strict mode and will prevent you from using ES2015 modules.
This commit is contained in:
Jeff Williams 2017-07-06 21:06:46 -07:00
parent f1017988ec
commit 67db938c0b
2 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ var defaults = {
includePattern: '.+\\.js(doc|x)?$',
excludePattern: ''
},
sourceType: 'module',
tags: {
allowUnknownTags: true,
dictionaries: ['jsdoc', 'closure']

View File

@ -1,12 +1,13 @@
'use strict';
var babylon = require('babylon');
var env = require('jsdoc/env');
var logger = require('jsdoc/util/logger');
// exported so we can use them in tests
var parserOptions = exports.parserOptions = {
ranges: true,
sourceType: 'module',
sourceType: env.conf.sourceType,
plugins: [
'asyncGenerators',
'bigInt',