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

Optionally indent with tabs #230

Open
lf- opened this issue Aug 15, 2022 · 1 comment
Open

Optionally indent with tabs #230

lf- opened this issue Aug 15, 2022 · 1 comment
Labels
good first issue new config option Adds or would add new configuration option

Comments

@lf-
Copy link

lf- commented Aug 15, 2022

Describe the option you'd like to add

For accessibility reasons (https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/), it is useful to use tabs for indentation as they are then configurable in the editor. It appears that Fourmolu currently doesn't support using tabs for indentation at all. For what it's worth, there is currently a possible movement to change the default in prettier to use tabs: prettier/prettier#7475

I personally have to use a rainbow indent guides plugin for 2-space indented code as I can't visually distinguish between levels, which helps marginally, but it would be ideal to have the ability to change the width in my editor.

indent-style: tab
indent-style: space

bikeshed: indentation: tab might be another way of writing this

  • What option setting would keep current behavior?
    indent-style: space

Show a code example exemplifying the different option settings

module Mod where

-- indent-style: tabs
sayHello = do
	putStrLn "hello"
	putStrLn "world"

-- indent-style: spaces (with indentation: 2)
sayGoodbye = do
  putStrLn "goodbye"
  putStrLn "world"
@brandonchinn178 brandonchinn178 added good first issue new config option Adds or would add new configuration option good first issue and removed good first issue labels Aug 15, 2022
@georgefst
Copy link
Collaborator

bikeshed: indentation: tab might be another way of writing this

Seems preferable to me, in the usual vein of "make illegal states unrepresentable".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue new config option Adds or would add new configuration option
Projects
None yet
Development

No branches or pull requests

3 participants