-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add ES5 check to syntax test #1540
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
Conversation
Note: CI failure can be considered a success. 🎉 |
tasks/test_syntax.js
Outdated
var validFiles = []; | ||
for(var i = 0; i < files.length; i++) { | ||
var f = files[i]; | ||
var isMin = !/[^(min)]\.js$/.test(f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've negated a negation… that's silly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use this list, something like:
var validFiles = constants.partialBundlePaths(function(p) { return p.dist; });
validFiles = validFiles.concat(constants.pathToPlotlyDist)l
var report = cli.executeOnFiles(validFiles);
// ...
looks easier to read to me. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds great. Didn't know it was a thing. Will update once confirmed it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Included plotly.js
but left out with with-meta
to save a few seconds.
tasks/test_syntax.js
Outdated
} | ||
} | ||
|
||
var report = cli.executeOnFiles(validFiles); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too bad eslint
can't do this in an async way. This does slow down test-syntax
a lot. Oh well, it's worth it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's always the possibility of just testing the regular bundle only since there's tons of duplication between the bundles, but I'd need to investigate to figure out which parts are a subset of which parts.
Fixed file lookup. FYI you can just switch ecmaVersion between 5 an 6 to test success/failure. |
💃 after merging |
See #1539. Uses another eslint pass that applies no rules except for an
ecmaVersion: 5
parser setting. Before the const fix, this change causes plotly-latest to return:After fixing: