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

Eslint and/or prettier run #429

Open
dotJack opened this issue Nov 15, 2023 · 2 comments
Open

Eslint and/or prettier run #429

dotJack opened this issue Nov 15, 2023 · 2 comments

Comments

@dotJack
Copy link
Contributor

dotJack commented Nov 15, 2023

I am running into some issues with inconsistent styling and would like to request that the recommended eslint / prettier formatting is done on the whole project. I don't really have a preference as to which format / style is used and I leave that up to the maintainer. I can change my workflow to accommodate any consistent style. I don't want to step on any toes but it makes sense to me to have the whole project saved in the same styling, whatever that styling may be.

Since I don't know what your editor's rules are, I'd like to request that the js files get a 'Format Document' or 'Format Document With' and one of the suggested vs code extension implementations run on them.

If there's some specific styling preference that parts of the code are formatted in one way and other parts are formatted in a specific but different way, then it's fine and you can close this issue.

Personally, it's a lot of mental overhead to manually align the mixed use of only tabs, only spaces and tabs and spaces since I rely on formatting for readability, ease of development and staying in flow.

Again, if it's some specific reasoning and it's just a hassle to deal with this, feel free to close this issue.
<3

@jagenjo
Copy link
Owner

jagenjo commented Nov 17, 2023

Hi Jack:

I always had my own styling but it was pretty flexible. But some years ago one user did a PR with a full linting of the code and I accepted it because I thought it could make it more coherent, but the truth is that the ruleset applied made the code way less readable so I decided to reformat it manually in some parts, I guess thats the problem with the current ruleset.

But feel free to lint it and do a PR, Im always willing to check it, I lack the experience you have probably.

@0xdevalias
Copy link

0xdevalias commented Dec 4, 2023

In the JS-world of things, prettier is fairly standard, and there are a few little things that can be tweaked within it to align closer to desired standards:


From a quick skim of the issues, I think this may have been where the 'undesired style changes' were previously mentioned:

Hey @NateScarlet just wanted to thank you for your help, it is nice that somebody besides me pushes this project, but please, do not launch the process that "beauytifies" the code again, most of the changes are against my way of working, specially one line ifs, and ifs where the condition touches the parenthesis.

My eye-sight is not so good and having all cramped in one line makes it hard for me to read it.
Can that be configured somehow? otherwise I have to go line by line fixing it.

Originally posted by @jagenjo in #68 (comment)

per prettier/prettier#4125 it seems bracket is needed to avoid single line if by prettier
but eslint seems has a rule match your need: https://eslint.org/docs/rules/curly
i will try configure it with eslint

Originally posted by @NateScarlet in #68 (comment)


Related:

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

3 participants