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

Any priority of the settings? .editorconfig vs .jsbeautifyrc vs atom preference #533

Closed
gddabe opened this issue Sep 3, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@gddabe
Copy link

gddabe commented Sep 3, 2015

I found at least 3 places for setting up atom-beautify.

  1. Atom -> Preference -> Installed Package -> atom-beautify
  2. .editorconfig in the project root folder / home directory
  3. .jsbeautifyrc in the project root folder / home directory

I have a .jsbeautifyrc in home directory with html indent_size = 4, while I have a .editorconfig in a project root folder with html indent_size = 2, it seems to me that jsbeautifyrc is overriding the editorconfig. I am quite confused here. What is the best practice on using all these files? Is there any dependencies / priority of them?

@Glavin001
Copy link
Owner

Here is the applicable section of code: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/index.coffee#L737-L755

# Combine all options together
    allOptions = [
      {
        _default:
          editorOptions
      },
      configOptions,
      {
        _default:
          homeOptions
      },
      editorConfigOptions
    ]
    # Reverse and add projectOptions to all options
    projectOptions.reverse()
    allOptions = allOptions.concat(projectOptions)

    # logger.verbose(allOptions)
    return allOptions

Options in order from lowest to highest priority:

I hope this helps! Please let me know if you have any more questions.

@Glavin001 Glavin001 self-assigned this Sep 3, 2015
@Glavin001 Glavin001 added this to the v0.29.0 milestone Sep 3, 2015
@Viveur
Copy link

Viveur commented Jul 11, 2016

Nice answer. Imo would be good to see this included in the docs / README

@Glavin001
Copy link
Owner

Imo would be good to see this included in the docs / README

I absolutely agree. IMO as well. I am still working on improving the documentation as I find time.

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

No branches or pull requests

3 participants