Closed erwstout closed 6 years ago
ES6 is so pretty. I can't wait. Like default parameter values. Can you say, "finally!"?
I agree and this is easy to do. Heres an example of how to implement it:
// Lint JavaScript
gulp.task('js:lint', () => {
return gulp
.src(SOURCES.js)
.pipe($.plumber())
.pipe($.babel())
.pipe($.eslint())
.pipe($.eslint.format())
.pipe($.eslint.failAfterError());
});
it would be a good idea to add a es6
or babel
folder though. By default Babel will take the source file and compile it in place, and for me that can lead to confusion if your not careful. So just like there is a scss
folder that compiles its contents to css
, we should have a es6
or something that compiles into js
.
Also, I think we should revisit something I brought up before, and that is getting rid of jshint
in favor of eslint
. http://eslint.org/
Quick update on this, for those who are waiting. We've been using/trying different methods of this on some projects to find the best workflow. Since jQuery and ES6 can sometimes clash, we're treading lightly. As of right now I'm thinking that we separate ES6 files from other JS files and have separate tasks for each. Any input would be appreciated.
Delayed. This will be rolled out with release/5.0.0
This is completed, but needs some extensive testing before deployment. If you want to test or try it out, you can install with npm: npm install factor1/prelude-wp#feature/es6
Failed a lot of the testing, not sure the best approach forward. Will post more details soon.
Closing for now ðŸ˜
We will leave it up to the dev to integrate ES6 if they want to.
Would like to update/add ES6/Babel support out of the box.