Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"--polyglot" option does not appear to be available through the passed gulp options, no es6 support. #5

Closed
benderTheCrime opened this issue Jun 30, 2015 · 1 comment

Comments

@benderTheCrime
Copy link

Related to this issue:
documentationjs/documentation#112

ES6 documentation cannot be created without the --polyglot option. It does not appear as though I can pass this argument via gulp, as demonstrated by my task:

gulp.task('documentation', function() {
    gulp.src(src)
        .pipe(documentation({
            format: 'html',
            polyglot: true
        }))
        .pipe(gulp.dest('md-documentation'));
});

and the error I get as a result:

events.js:141
      throw er; // Unhandled 'error' event
            ^
Error: Parsing file *: 'import' and 'export' may appear only with 'sourceType: module' (4:0)

but not via the CLI:
documentation * --polyglot

@tmcw
Copy link
Member

tmcw commented Jun 30, 2015

ES6 documentation cannot be created without the --polyglot option.

While this repo does need a version bump on its documentation dependency in order to support the --polyglot option, as mentioned on the other ticket: this is a misunderstanding:

  • --polyglot is for non-JavaScript code
  • Default mode aims to cover ES5 and ES6 code

What you've stumbled on is a bug in espree/ast-types. Once that's fixed, you won't need to pass polyglot as an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants