millermedeiros / esformatter

ECMAScript code beautifier/formatter
MIT License
970 stars 91 forks source link

How to exclude file paths? #499

Open mcandre opened 4 years ago

mcandre commented 4 years ago

How are users supposed to configure esformatter in order to exclude custom file paths? I'm having trouble finding this option in the provided documentation. For example, CoffeeScript projects will want to jsfmt any Gruntfile.js, Gulpfile.js scripts, but otherwise ignore any lib/*.js or similar compiled JS paths.

As a workaround, one could use UNIX find, xargs to wrap esformatter over specific file patterns, but this option should really just be built into jsfmt itself for cross-compatibility. And it's rather involved to implement an accurate shell script snippet for allowing bin/<NodeJS-script-with-a-shebang-but-without-a-file-extension>, compared to doing this right in esformatter.