Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deno fmt and deno lint should ignore hidden directories by default #26573

Open
bartlomieju opened this issue Oct 27, 2024 · 2 comments · May be fixed by #26897
Open

deno fmt and deno lint should ignore hidden directories by default #26573

bartlomieju opened this issue Oct 27, 2024 · 2 comments · May be fixed by #26897
Labels
deno fmt Related to the "deno fmt" subcommand or dprint dx lint Issues related to deno lint

Comments

@bartlomieju
Copy link
Member

Reproduction in #26519 (comment) makes it very clear
that formatting and linting directories like .next/ is not a good idea.

It takes a long time and makes little sense - the build artifacts are best left alone unless user really means to format them.
So I think we should change the default globs for deno fmt and deno lint to exclude hidden directories by default.

The reason to exclude all hidden directories is that if we decide on a list of directories to exclude, we'll have to keep adding to it - .next, .vite, .vitest, etc. 99% of users don't want these directories to be touched by deno fmt, as recently shown in #26402.

@bartlomieju bartlomieju added deno fmt Related to the "deno fmt" subcommand or dprint lint Issues related to deno lint dx labels Oct 27, 2024
@dmint789
Copy link

I don't think this is a good approach, because some projects don't set the build directories as hidden (e.g. Nest JS with the TS dist directory), and it's also feasible that some project could have an actually useful hidden directory. I think it would be better if the include option just worked more predictably. In that linked reproducible example I have just the *.ts files included, but the formatter and linter still try to process other file types too.

@bartlomieju
Copy link
Member Author

Going to go with #26897 which respects .gitignore file and doesn't fmt/lint files that are ignored - this should cover most cases as various frameworks will produce .gitignore files that exclude and dist/build directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deno fmt Related to the "deno fmt" subcommand or dprint dx lint Issues related to deno lint
Projects
None yet
2 participants