How close should a french drain be to a foundation?
Typically a perimeter drain system is installed within 12 inches of the foundation wall. The gravel backfill then rests against the foundation and the pipe is 6 inches or so out from the wall.

In your case, I don't think it would make much difference in the performance of your drain. Not sure exactly what you meant by 18" max. Is the foundation only 18" deep or your drain to be installed no more than 18" deep?  You definitely don't want to dig deeper or too close to a shallow foundation so as not to undermine it.  Good luck.