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

docs(names): indentPref vs. indentSpaces #435

Closed
Kristinita opened this issue May 5, 2018 · 1 comment
Closed

docs(names): indentPref vs. indentSpaces #435

Kristinita opened this issue May 5, 2018 · 1 comment

Comments

@Kristinita
Copy link

Kristinita commented May 5, 2018

1. Summary

In Stylint documentation I read about 2 options: indentPref and indentSpaces. Possibly:

  1. They denote the same option
  2. indentPref incorrect and needs replacing

2. Citations

  • indentSpaces:

indentSpaces (default: 4, number or false)

This works in conjunction with depthLimit. If you indent with spaces this is the number of spaces you indent with. If you use hard tabs, set this value to false.

By default this value is 4, so if you indent with hard tabs or 2 spaces you'll need to manually set this value in a custom .stylintrc file. With default settings, this means the depth limit is 4 indents of 4 spaces each.

  • indentPref:

mixed (default: false, boolean, relies on indentPref)

Returns true if mixed spaces and tabs are found. If a number is passed to indentPref (4 is the default), it assumes soft tabs (ie, spaces), and if false is passed to indentPref it assumes hard tabs.

If soft tabs, throws warning if hard tabs used. If hard tabs, throws warning if unnecessary extra spaces found.

Example if indentPref: 4 and mixed: true: prefer \s\s\s\smargin\s0 over \tmargin\s0

Example if indentPref: 2 and mixed: true: prefer \s\smargin\s0 over \tmargin\s0

Example if indentPref: false and mixed: true: prefer \tmargin\s0 over \s\s\s\smargin\s0

Thanks.

@Kristinita
Copy link
Author

Status: ❗ Another problem

#437.

Thanks.

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

No branches or pull requests

1 participant