Open end-user opened 8 years ago
Hardly any ES6 is supported I believe. A workaround is to run the stream through babel before sorting it.
Make sure you have babel-preset-es2015 installed, and pipe the stream to gulp-babel like so
.pipe(babel({ presets: ['es2015'] }))
.pipe(angularFilesort())
I believe it's the outdated version of ng-dependencies@0.3.0 it's using.
gulp
.src('./**/*.js')
.pipe(angularFilesort())
.on('error', gutil.log)
[DATESTAMP] { [Error: Error in parsing: "FILE", Line NUMBER: Unexpected token =>]
message: 'Error in parsing: "FILE", Line NUMBER: Unexpected token =>',
showStack: false,
showProperties: true,
plugin: 'gulp-angular-filesort',
__safety: { toString: [Function: bound ] } }
This error is not present if I change the ng-dependencies
version in ./node_modules/gulp-angular-filesort/package.json
to 0.5.0.
Seems like overkill to babelify when it really only needs to parse the angular.module('name', [deps])
portion.
Were there any changes to ng-dependencies@0.5.0
in regard to AST building?
this project is definitely abandoned, time for a fork i guess
So is streaming through babel the only work around for now?
If I use an arrow function in my js file, gulp-angular-filesort is throwing an error (e.g. "Error in parsing: "expert\controllers\ExpertViewController.js", Line 14: Unexpected token =>")