-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Should we use Prettier? #7
Comments
I talked a little while ago about this issue. |
I prefer to take a full prettier format on the existing code. However, it is pretty tedious and error-prone to add different versions of prettier/husky/lint-staged to the existing projects. Actually we have suffered from outdated eslint config on less frequently updated package. It comes to me that lerna can reduce these maintenance nightmare if we switch to monorepo so that all hexo packages shares eslint/babel/prettier/lint-staged settings. |
If you do monorepo and organize the registry, you should also consider using When doing them, at least we should inform this to all Hexo maintainers. |
The npm scoped package is definitely nice to have but it is breaking change for users. As we have separated hexo packages in the very early days, from the users perspective, it is not persuading to change Additionally, the monorepo and scoped npm package is independent.
Good idea, could you raise a discussion on the main repo? |
ok, For each member of @hexojs/core, we set up a discussion thread. |
It can be quite a nice move to find the right setup of prettier on this repo first before even trying to scale it to a larger amount of repos. Prettier has some nice commits hooks where it can only be applied to changed lines. That can be replicated bit by bit to other repos and see how much pain/benefits it generates before thinking to move to monorepo (this brings its own bagage of discussions/painpoints without solving the prettier problem). |
@oncletom Is the hook you are talking about |
@segayuu yes exactly. I have tried this one and the plain git command. But the latter is not cross-compatible between OSes. |
Yes please use prettier 👍 |
I don't have any strong opinion about the actual linter, as long as the style used is uniform across the project. (You can keep eslint or switch to prettier, as long as the same rules are enforce everywhere). I'm not comfortable with lerna and monorepos for JS (seems to be at odds with Node's way of doing things). To help with maintaining dependencies up to date, you can look into integrating "Greenkeeper". I'm only an occasional maintainer so I have no strong opinions on this either. |
@demurgos Prettier integrates into ESLint so ESLint parses and validates it while the Prettier plugin does the formatting. I would like to see this happen and most of the rules having to do with formatting can be removed. @segayuu If you want to do some experiments we can work on a branch together and then run these rules on various hexo repos and see what would change, if anything. |
In #10 we added |
eslint
has nearly 90 rules even for categoryStylistic Issues
alone.It is very difficult to handle all these correctly.
Because
eslint
understands that, if you activate only recommended settings, required items in most projects will be set. However,Stylistic Issues
often depends on individuality, the recommended config isno-mixed-spaces-and-tabs
only.By using
Prettier
it is certain that almost all of those settings will be unified.However, that is a tradeoff with fewer things we can explicitly control.
In fact, the
multi-line
option of thecurly
rule will be disabled withPrettier
!The text was updated successfully, but these errors were encountered: