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

create a noop preset #113

Closed
millermedeiros opened this issue Dec 16, 2013 · 6 comments
Closed

create a noop preset #113

millermedeiros opened this issue Dec 16, 2013 · 6 comments

Comments

@millermedeiros
Copy link
Owner

this preset wouldn't make any changes to the input, that way we can implement style changes that are less obtrusive and don't need to reset all the properties (just inherit from the noop preset and override the needed options).

this will only be possible after we add support for -1 to the config options.

PS: issue #1 and #84 are blocking this.

@millermedeiros
Copy link
Owner Author

this is still not possible, there are still some calls to _tk.remove and _tk.removeEmpty[InBetween|AdjacentBefore|AdjacentAfter]... which means that passing the code through esformatter will always cause side effects.

lowering the priority for now since there are more important bugs to fix. but I would really like to have a noop preset in the future, since this proves that tool is really configurable. (even tho convention > configuration)

@bcomnes
Copy link

bcomnes commented Mar 4, 2015

Would creating a default preset with options to set to -1 be a good start here?

It would be nice to have the option to use esformatter from a noop state, and configure it as needed. Hunting down how some of the different rules interact with each other can be tedious.

@millermedeiros
Copy link
Owner Author

that wouldn't help.. we are planning to kill all the presets besides the default (convert them into plugins). right now even if all settings are -1 it will still change the code.

@millermedeiros
Copy link
Owner Author

I'm not going to work on this.. if you don't want the code to change use a different tool, maybe echo or tee 😜

@bcomnes
Copy link

bcomnes commented Mar 26, 2015

Thats fair given the work involved :)

@millermedeiros
Copy link
Owner Author

for future reference:

we have a bunch of calls to limit that passes a number as second argument - these changes will always happen, no matter what settings you pass. Most of the cases are actually things that you want to happen (eg. always enforce a single space after the new keyword), but in some cases they are hardcoded just because we didn't have a name for that option or didn't think anyone would need to configure that...

There is also the indent.sanitize call (which will remove the original indentation) - we always re-indent the whole file, but this should be easy to ignore with a flag...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants