sbt-jshint icon indicating copy to clipboard operation
sbt-jshint copied to clipboard

How to lint non-asset directory

Open hatashiro opened this issue 10 years ago • 5 comments

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.

hatashiro avatar Aug 08 '14 03:08 hatashiro

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

toc777 avatar Dec 03 '14 21:12 toc777

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?

huntc avatar Dec 05 '14 21:12 huntc

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

toc777 avatar Dec 08 '14 20:12 toc777

Is there anyway to lint the compiled assets? Let's say the result of compilation (transpilation) of coffeescript files form app/assests/js ?

naderghanbari avatar Mar 01 '15 16:03 naderghanbari

+1

ikr0m avatar Aug 10 '17 09:08 ikr0m