sbt-jshint
sbt-jshint copied to clipboard
How to lint non-asset directory
Hi,
I have a non-asset directory to be linted. My project is based on Play 2.3.2 and the directory structure is like this:
- app
- assets
- js
- plugins
There're JavaScript files in both ./app/assets/js
and ./plugins
. Files in ./app/assets/js
are linted without any settings, but I don't know how to include ./plugins
in the directory to be linted.
I tried this:
sourceDirectory in Assets <<= baseDirectory(_ / "plugins")
Then I can lint the files in ./plugins
but at that time ./app/assets/js
is excluded. I think it just changed sourceDirectory
, not adding the directory to it.
Is there any way to lint both of them?
Thanks in advance.
I would also like the ability to do this. I am using the Play Framework where by convention, static javascript files are kept in app/public. I would rather change the source directory of sbt-jshint rather than move all my javascript to app/assets
This can be achieved but I'll have to look at the plugins settings and get back to you.
Please note though that by convention, app/assets denotes source assets to be preprocessed. Why are you wanting to go against that?
I guess we have a different understanding of what should be in app/assets. From what I have read, app/assets denotes source assets to be compiled/transformed in some way. For example, the coffeescript plugin compiles coffeescript files found in app/assets and outputs javascript files into app/public
Since JSHint doesn't modify files, I think it should be possible to run it on app/public
Is there anyway to lint the compiled assets? Let's say the result of compilation (transpilation) of coffeescript files form app/assests/js
?
+1