Having a cljc file at path {{public/js/out/foo/bar.cljc}} with ns form {{(ns foo.bar)}} will result in namespace {{foo.bar}} being reloaded.

This is problematic because ClojureScript compiler will copy all the input files to {{:output-dir}} for source-map use. Lately as more libraries have started using cljc, and this has started causing problems in cases where library is used on Clojure env. Cljs compilation will result in reload of the library code, which can redefine protocols etc. and break the Clojure env.

I think it would make sense for tools.namespace to ignore changes where file path and namespace don't match.
Another question and perhaps way to fix this, is to understand why dependency resolution doesn't work in this case: namespaces which depend on the protocols at a cljc file on output-dir aren't reloaded.

I applied and installed this locally and tested with one Boot projects where I know Cljs output contains some [[.cljc}} namespaces, and this indeed ignores those.

Two notes:

Every time I call refresh, I get the warning about directory being ignored. This does add a bit clutter, but is probably acceptable, as system restart will probably log a few lines anyway in most cases.

One thing that might be a problematic, is that if single file has bad ns declaration at some point, e.g. user accidentally has typo on the name, the whole directory is ignored untill {{clear}} is called. This will probably cause confusion. Would it make sense automatically remove ignored directories if the problematic files are fixed? Looks like that would be possible in {{find-files}}.

-5 patch modifies {{find-files}} to check ignored directories if all the ns declarations in the directory have been fixed. I had to move the side-effects from predicate functions to {{find-files}} so this is not the cleanest change, but should work. I should be able to clean this a bit if this seems like good approach.