-
Notifications
You must be signed in to change notification settings - Fork 304
Feature: check for syntax error on build #478
Comments
Adding a linter builder plugin could make the most sense for this I think. That way it could just pick up a bunch of different things including syntax errors. |
i'm not sure how to do this without actually parsing the javascript with esprima or jshint or something, which would make builds VERY SLOW. would be better as a plugin for now, then we can think about adding it once it's working well |
or something. |
oh yeah. i run lint in a separate process on every build. it's super slow though - 50ms builds and 2.5s lint? which is why i don't run lint in the same process as the builder and don't really want to advocate putting it in the builder (unless someone makes it really fast with caching n stuff, though i lint my server-side js at the same time for the hell of it) |
I pretty much never lint haha, IMO this more of a CI / editor feature. it could be a plugin for component but definitely not core |
@airportyh as far as your issue goes, use the 0.10.x releases of builder |
Syntax error checking can actually be done fast w/o using Esprima - by executing the script and then checking if a syntax error was thrown, see syntax-error. This is what's being done in browserify, and is indeed fast (I've some experience doing perf tuning in browserify recently). I can put in some benchmarks to prove it if needed. I think this is a nice improvement in UX w/o performance penalty. @visionmedia so new development should be done on 0.10.x branch? are there plans to upgrade component to the latest of builder? |
yup we want to upgrade eventually but we need some more breaking changes to 0.12.x |
👍 it would be nice to use something like this as a plugin in the new builder API. |
I'd like to add the feature of syntax error checking to
component build
. If any of the components have a syntax error, it would error out. Had a look at the code and it seems the proper place to put it would be component-builder. However, component itself isn't linking to the latest version of builder, see here. When I tried to update component to point to builder's latest, I got this errorNot sure which route to pursue. Please help point me in the right direction.
The text was updated successfully, but these errors were encountered: