-
Notifications
You must be signed in to change notification settings - Fork 321
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
Support for ES6? #127
Comments
Plans come at the parser level and then the analysis level. Nothing will likely come until esprima supports es6 proper. They've stated that won't happen until the spec is ratified or at least until it fully stabilizes. That said, there were no syntax changes proposed at the last TC39 meeting and ratification is reportedly imminent. |
Hi @jsoverson, I'm a contributor to 6to5 (and marionette 😜). If you need any help with this let me know or feel free to stop by our gitter room. |
@thejameskyle i'm expecting some new developments for javascript parsing in the next few weeks so am holding off until those settle. If you're interested in coming down to MV from SF sometime soon we could go over some of the details at Shape. Lunch is on me :-) |
@jsoverson That sounds ominous 😜. I'd love to head down to Mountain View, I've been wanting to tour the google campus too. |
+1, JSX support also will be great! |
+1 |
5 similar comments
👍 |
👍 |
👍 |
+1 |
👍 |
Support for checking .es6/.es files will be available if #153 is merged in. Statistics and proper analysis will come later when that is ready. |
+1 |
1 similar comment
+1 |
👍 for ES6 + JSX |
@jsoverson sounds like people want this 😜 |
@thejameskyle yep, i'm working on v2 now which supports modular reporters. If someone wants to update v1 with es6 support, then I'm all for it. I just can't justify splitting my effort when I already have little time to work with :-/. |
For those who don't want to wait... Here's a simple npm script to unJSXify your source, move it into a separate dir and then plato it :) package.json:
$ |
+1 |
Could you use https://github.com/eslint/espree instead of esprima? It looks like espree exists because esprima is slow catch up to es6. Also: +1 |
For anyone who can't wait for es6 support: You can run babel (6to5) manually on the files and then run plato on output. You might not get the right complexity numbers because of some generated code that is not in the orignal es6 code, but it's better than nothing. Grunt config for grunt-babel: babel: {
options: {},
plato: {
files: [
{
expand: true,
cwd: 'app',
src: ['scripts/**/*.js'],
dest: '.tmp/plato'
}
]
}
} Grunt config for grunt-plato: plato: {
options: {
jshint: grunt.file.readJSON('.jshintrc')
},
quality: {
files: {
'plato': ['.tmp/plato/scripts/**/*.js']
}
}
} Don't forget to clean the .tmp dir clean: {
test: {
files: [
{
src: ['.tmp/plato']
}
]
}
} |
I tried that some time ago and you can actually get rid of the generated es6 code if you are willing to write your own reporter and add couple of if statements there. |
Has anyone tried piping output from babel into plato? I would like to minimize the amount of I/O operations caused by writing/reading from disk. |
The problem is that Babel add a lot of complexity for its needs, you will have a not really convincing report. But it could be a great start. |
Yeah, you can also use babel's runtime option to remove the fluff from compiled files. I find it to be a good start while we wait. |
Currently, I'm going through Git history to generate a report over time. If I could stream the output from Babel into Plato it will really help me eliminate all the I/O ops. |
+1 |
2 similar comments
+1 |
+1 |
+1 |
@jsoverson Want to lock this issue? These +1s are really useless and annoying but I don't want to unsubscribe from this thread in case something does happen with it. |
+1 |
1 similar comment
+1 |
Please refrain from just commenting with +1s. They don't add any meaningful discussion to the issue. |
@rodoabad this is currently the only way to display your interest on github. I like to think this helps the developers prioritising. To avoid the clutter in the comments I would advise this chrome extension. |
As someone who helps maintain one of the largest github projects, no it absolutely does not help with anything. I actively delete +1s on our repositories and lock issues where people are spamming us with them. We universally hate it, so just stop. |
supported by @devcrust in 1.6.0 |
Any plans of supporting ES6? We're working on a project that uses ES6 (through 6to5) and would love to be able to measure complexity based on that versus the converted ES5 code.
The text was updated successfully, but these errors were encountered: