-
Notifications
You must be signed in to change notification settings - Fork 486
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
Crashes on ESLint require-jsdoc directive comments #1090
Comments
Here is the root cause: browserify/detective#45
And I think |
This seems to only happen when the source file has a |
The babelify transform is not transforming source from .mjs files for some reason. I've created a dirty noop transformer to log out what is happening: const through = require('through2')
function (file) {
return through(function (buf, enc, next) {
const str = buf.toString('utf8')
console.log(str)
this.push(str)
next()
});
} Adding it after the babelify transform here reveals that when the extention is I've checked the result of the |
Idea: Maybe we need to use the I don't really understand how this all fits together though, since I though we were force feeding the transformer all the files gathered by a glob, instead of an index with imports that needs to be recursively resolved. I get the feeling it would be better to use Babel APIs directly instead of this dated browserify setup. I'm not sure why transpilation is actually necessary at all, since there are parsers available that can understand modern syntax and even JSX. |
This bug confused the heck out of me!
This:
Or this:
Will cause the documentation.js CLI to crash for either
lint
orreadme
operations with an error similar to this example:Take away the comments and it works fine. I think the
require
part of the comment is erroneously causing some sort of import analysis to happen, which happens to fail because there is JSX in the file. Maybe this accidental analysis would go unnoticed if it weren't for the JSX, or maybe it would error on something else. I don't know.The text was updated successfully, but these errors were encountered: