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

Ignore spesific files #2195

Closed
ringvold opened this issue Jun 19, 2017 · 8 comments
Closed

Ignore spesific files #2195

ringvold opened this issue Jun 19, 2017 · 8 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:enhancement A potential new feature to be added, or an improvement to how we print something

Comments

@ringvold
Copy link

ringvold commented Jun 19, 2017

Hi!
First: Thank you for creating and maintaining Prettier! πŸ™‡β€β™‚οΈ It is a great resource for the community!

I would love to see support for ignoring spesific files. I know there are ways to to this by using eslint but it is a bit more complex then I would like.

I have situations where I would like to be able to put a comment at the top of the file and it would be ignored (kind of like eslint). I use prettier mostly as an editor integration so I guess this could be done in the editor plugins but it seems like quite a lot of work for the plugins to do when prettier is already parsing the files.

There are more and more cases where I would like to ignore one or to files in a project or just single js-files that is not part of a project. I find my self having to disable prettier when editing certain files (and then re-enable it) or remember to use another editor for those files.

Having project spesific config like the discussed somewhere in issue #98 combined with config option to ignore files would solve most of my cases but I would like to have an in-file comment version as well.

Is this something you would consider?

@vjeux
Copy link
Contributor

vjeux commented Jun 19, 2017

This is something that we need to solve indeed. I'm not really sure at which level but will be worked on in the coming weeks.

@vjeux vjeux added the type:enhancement A potential new feature to be added, or an improvement to how we print something label Jun 19, 2017
@chadly
Copy link

chadly commented Jun 19, 2017

I know there are ways to to this by using eslint but it is a bit more complex then I would like.

/* eslint-disable prettier/prettier */

I don't know how you get simpler than that.

@jitendravyas
Copy link

I had same question #1977

@ringvold
Copy link
Author

@vjeux Cool. Nice to hear you are aware and thinking about it. :)

@chadly Yeah that is not bad if you allready have eslint set up. But I use prettier from my editor and many files are not in a project with eslint so that would need to be set up for all 70+ project I have on my work machine, which does not scale or make sense (for me at least). Other files are not part of a project but standalone files where some of them should not be formatted. Maybe there are other ways to set it up other than per project? Do I need do stop using Prettier through the editor?

Weird example: Fiddler custom rules scripts file which is JS but not quite (FiddlerScript). This language does not support the "trailingComma": "es5" setting which I use everywhere else.

@jitendravyas Ah. Nice. I did not see that one. Though my use case is a bit different it does make a case for some kind of ignore mechanism in Prettier.

Obviously I would like a solution to contain some kind of comment support so I can ignore the files that create probles for me.

@azz
Copy link
Member

azz commented Jun 21, 2017

Prettier already has // prettier-ignore for specific code segments, would a // prettier-disable similar to /* eslint-disable prettier/prettier */ do the trick?

@ringvold
Copy link
Author

@azz ooO! That is nice! But it means I failed to read the manual. 😞
// prettier-ignore is definitely better then nothing so I can get some relief straight away with that one.
That helps a bit but it would be nice to have something similar for the whole file. :)

@azz
Copy link
Member

azz commented Jul 30, 2017

The next release will support .prettierignore and --ignore-path.

@azz azz closed this as completed Jul 30, 2017
@slunecniborecek
Copy link

slunecniborecek commented Oct 18, 2017

@azz when will this be supported exactly please? or what version should I watch for? Thanks

never mind :) I've found it's version 1.6

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

No branches or pull requests

6 participants