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

proj: add prettier #1

Open
unional opened this issue Apr 24, 2020 · 6 comments
Open

proj: add prettier #1

unional opened this issue Apr 24, 2020 · 6 comments

Comments

@unional
Copy link
Member

unional commented Apr 24, 2020

Once we have some code, I would like to add prettier to the tool chain so that it will automatically format your code.

@venikman
Copy link
Collaborator

So funny that we don't have it with so much config files =) But I am up to work on it with you!

@unional
Copy link
Member Author

unional commented Apr 28, 2020

I don't have it because I personally have not used it.
So when adding it in I need to figure out the configurations so that it would fight with the particular linting rules that I use, and not contradicting with the guidelines I have here:
https://github.com/unional/typescript-guidebook

@unional
Copy link
Member Author

unional commented Jul 8, 2020

Tried Prettier and don't like it so far.
It creates contradicting rules so that VSCode can't format the code to satisfy those rules automatically.
For example,

import { createPluginCommand } from 'clibuilder'

export const scanCommand = createPluginCommand({
  name: 'scan',
  description: 'scan source files for strings to translate',
  run() { },
})

Prettier wants run() { } to be run() {},
but wants { createPluginCommand } to remain with space.

@venikman
Copy link
Collaborator

@unional I know Deno use other styler. Let me check if I can find which one

@venikman
Copy link
Collaborator

Hm can't find it. Only what I have found: https://deno.land/manual/tools/formatter
But I know they replace prettier with other formater... or we can try to write in Deno and use build in formatter

@unional
Copy link
Member Author

unional commented Jul 14, 2020

Very likely Deno does use that default formatter.

It's the same approach as in Go and Rust. It's good to be opinionated by the language is that way. :)

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