When does coffeelint run?

62 views
Skip to first unread message

kenc...@gmail.com

unread,
May 12, 2014, 11:31:33 AM5/12/14
to mimo...@googlegroups.com
Just discovered mimosa recently and started using it on the weekend. Wow! Such an awesome tool!

I keep discovering more plugins. I was thinking "It would be cool if supported node reload functionality too. Oh...there's a server-reload plugin!" Seems there's a plugin for everything I wanted. :-)

One thing I had an issue with was coffeelint. I'm using iced coffeescript, and it doesn't appear that coffeelint is running against my .iced files. I set a line length limit of 10 characters as a test, but that didn't generate any errors.

When I ran mimosa-web-package (mimosa build -omp), coffeelint ran, but I'm not sure if it ran against the .iced files or against the transpiled files.

Is it possible to run coffeelint explicitly against .iced files? I saw the extensions properties for iced and coffeescript, but it doesn't look like the coffeelint plugin has that config property.

Can I control when it runs? For example, every time a file is compiled (unless it's too slow for that)?

Thanks!

dbashford

unread,
May 13, 2014, 9:08:16 PM5/13/14
to mimo...@googlegroups.com
I just did a `mimosa new`, created an iced project, and then made a line that was too long.  I got an error as I'd expect:

21:04:32 - ERROR - CoffeeLint: Line exceeds maximum allowed length, in file assets/javascripts/app/example-view.iced, at line number 6, context 6

Some things to watch.  If you set the rule and then restart mimosa, nothing will happen because mimosa won't recompile a file that doesn't need recompiling.  So you'd have to save a file to see that rule fire.

It worked when you ran build because build starts with a clean. So it makes each file recompile.

Guessing that was your problem?

If you do come up with modules that don't exist, feel free to suggest them!

Ken Carpenter

unread,
May 15, 2014, 12:56:34 AM5/15/14
to mimo...@googlegroups.com
Hi David,

Thanks for the response.  What you described was one of the problems.  If I add a too-long line to main.iced, for example, I get the coffeelint error now.

However, if I add the same line to server.iced and save it, I get no error.  I'm assuming coffeelint is just not running on the server files, but I don't see how to configure mimosa to run on those files.

If I'm running "mimosa watch --server" and save server.iced, the server restarts, so mimosa is doing its thing, but no coffeelint error shows up.

Thanks,


Ken

dbashford

unread,
May 15, 2014, 11:20:33 PM5/15/14
to mimo...@googlegroups.com
Yep, Mimosa doesn't process server files the same way it does client files.  iced and coffee don't need to be compiled before being used, they can be compiled on the fly when they are required. 

Mimosa is chiefly a browser build tool.  It has hooks and tasks for server things, but coffeelint isn't one of them.  At least not yet. =p
Reply all
Reply to author
Forward
0 new messages