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

Store TS formatting preferences in tslint.json #65

Open
atsu85 opened this issue Aug 17, 2016 · 5 comments
Open

Store TS formatting preferences in tslint.json #65

atsu85 opened this issue Aug 17, 2016 · 5 comments

Comments

@atsu85
Copy link

atsu85 commented Aug 17, 2016

(copied from my comment in another issue)

Great place to store formatting preferences would be tslint.json. Tslint uses that file to lint typescript source files and in addition to checking for errors there are rules to check indent and other formatting rules related to whitespaces, linebreak style, no trailing whitespaces and many more.

Using this file would have multiple benefits:

  1. formatting styles are defined in a format that is not related to any specific IDE
  2. usage can be checked by build tools, IDEs (Atom, IntelliJ IDEA and probably many more) and command-line tools.
@atsu85 atsu85 changed the title store TS formatting preferences in tslint.json Store TS formatting preferences in tslint.json Aug 17, 2016
@atsu85
Copy link
Author

atsu85 commented Aug 18, 2016

Actually there are other good options to consider for storing the TS formatting preferences: looks like vvakame/typescript-formatter can read formatting rules from tslint.json, tsfmt.json and .editorconfig.

@angelozerr, have You considered using some other formatter instead Your own custom solution? There are also other tools, such as gulp-typescript-formatter that rely on vvakame/typescript-formatter

@angelozerr
Copy link
Owner

@angelozerr, have You considered using some other formatter instead Your own custom solution?

At first it's not my own custom solution, it's the standard mean with Eclipse preferences.

Yes I have started to study how to manage any formatter with extension point, but no time to implement it today. For the moment I'm studying debugging, I will study your idea when I will hav e time.

Anyway, thank's a lot for your great information about typescript formatter.

@atsu85
Copy link
Author

atsu85 commented Aug 19, 2016

@angelozerr, have You considered using some other formatter instead Your own custom solution?

At first it's not my own custom solution, it's the standard mean with Eclipse preferences.

I meant the formatter(code that formats TS), not the code/means where preferences are stored.

@angelozerr
Copy link
Owner

I meant the formatter(code that formats TS)

For that I call tsserver "format" command with the configuration comming from Eclipse Preferences by using JSON object https://github.com/angelozerr/typescript.java/blob/master/core/ts.core/src/ts/client/format/FormatOptions.java waited by TYpeScript. So it's not a custom solution. VSCode does like this too.

@atsu85
Copy link
Author

atsu85 commented Aug 19, 2016

Oh, my bad then.

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

2 participants