denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.02k stars 5.36k forks source link

`deno fmt` exclusions shouldn't apply for explicitly named files #20860

Open nayeemrmn opened 1 year ago

nayeemrmn commented 1 year ago

For example deno fmt vendor/path/to/file.ts should work, even though vendor is auto-excluded.

lino-levan commented 1 year ago

Does "explicitly named" mean just a file path, or do globs count as well?

nayeemrmn commented 1 year ago

For simplicity globs won't count.

Sure the "smartest" behaviour would be to include globs and directories as well in the case that the constant part of the glob passes the boundary of the exclude entry. That would be enough to indicate that you want to opt out of the exclude. But that's complex to both implement and document.

dsherret commented 1 year ago

I'm not sure about this issue. I think things like lint-staged will explicitly provide all files to something like deno fmt and some people might expect those explicitly specified files to still be excluded regardless.