-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
First pass at "deno fmt" config #11857
Comments
I've put many of my thoughts on this issue in: #11553(although its only on spaces it should still apply here). But in extension to that I'd like to add that Prettier pretty much works for everyone even though it only has like 4 or 5 config options, if anyone complains about the config options we can more or less redirect them to Prettier(as also noted in the discussion minutes). I believe allowing tabs while keeping whats currently there as defaults will make more or less everyone happy. (Single quotes rule is also very nice for all the touch typers out there). This becoming a thing would likely allow me to adapt deno fmt for all my deno projects as not being able to use 4 spaces/tabs has been stopping me from doing that. I feel like this is enough to keep |
Not every option is equally valuable. Prettier seems to regret adding some of them:
I'd advocate for initially allowing only If you want
I disagree. You can still type single quotes and let the formatter normalize them to double quotes. So it's purely aesthetic preference. |
Deno 2 could default to |
Doesn't really change the fact that prettier's current options(by that i refer to the 4 or so that are in the config file: trailing commas, tab/space width, semis and single qeuotes) work for pretty much everyone and satisfy pretty much everyone.
You are right, I had not thought of that at the time of writing that comment as I personally use |
Is there any chance of convincing you not to support this config option at all? |
It would be great to get an option for Markdown that turns off the the hard wrapping at 80 characters: #9191 |
Ref #11686
Ref #11855
Analogous to adding configuration for
deno lint
I propose to allow configuringdeno fmt
via a configuration file (and also using CLI flags as we don't want to haveoptions in config file that are not available via CLI). I propose to start
with minimal set of options; concretely allow only
useTabs
(that will helpwith the accessibility #3695),
tabWidth
andsingleQuote
To keep the same configurability in CLI I suggest to add
--rules-use-tabs
,--rules-indent-width
and--rules-single-quote
flags todeno fmt
subcommand.Similar to linter specifying CLI flags takes precedence over configuration in config file.
Alternatives:
fmt.files
and don't allow configuring rules,this would imply that we should switch default setting to use tabs instead
of spaces to address deno fmt accessibility #3695
The text was updated successfully, but these errors were encountered: