Skip to content

tns create generates editorconfig #4408

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

Closed
cowboyd opened this issue Feb 27, 2019 · 0 comments · Fixed by NativeScript/nativescript-app-templates#16
Closed

tns create generates editorconfig #4408

cowboyd opened this issue Feb 27, 2019 · 0 comments · Fixed by NativeScript/nativescript-app-templates#16
Labels

Comments

@cowboyd
Copy link

cowboyd commented Feb 27, 2019

Is your feature request related to a problem? Please describe.
99% of package.json files, use a 2 space indent, and so the default for most editors is that.

tns create --ng however, generates a package.json file with 4 space indent, but without an indication on how editors should treat it, it's a very reasonable default for them to use the norm. Which means that as you begin to work with the files, the editor is trying to make unecessary formatting changes to the code.

Describe the solution you'd like

As part of creating a new project, tns create also generates a .editorconfig file that has settings matching the files that get generated. E.g.

[*.json]
indent_style = space
indent_size = 4

This has two clear advantages:

  1. Whatever editor a deveolper uses, it will work seamlessly out of the box with a project created tns create
  2. Teams have a clear place to change the preferences if they decide that it should behave differently, and it will not effect the style settings on any other project.

Describe alternatives you've considered

Generate package.json files with indent: 2 since it is the norm on npm.

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

Successfully merging a pull request may close this issue.

2 participants