-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Introduce code linting #1024
base: master
Are you sure you want to change the base?
Introduce code linting #1024
Conversation
@expelledboy no doubt this is required:) |
So I can introduce this as both a pre-commit hook and into I dont want to make too many changes to introduce linting, and I am not confident yet with the codebase. |
Okay so I disabled even more checks 🤣 well yolo, we can bring in more rules as and went we don't have large branches to merge. |
Nice CI working with https://travis-ci.org/github/amark/gun/builds/742923538#L230 |
Am I pushing it too far to also add code coverage limit of 65% while I am at it? :) You guys actually have done a solid job so far! I wasnt expecting to set to all the way up
Another question is would you like it to run a full |
e0aa43d
to
6026a58
Compare
I dont know how this is merge conflicting, I literally copy the file over mine from master... |
/gun.ts | ||
/temp/ | ||
.nyc_output/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This btw is a prefect example of why you need linting. This file clearly had CRLF line breaks, and because I added 1 small change at the end my editor detected inconsistencies and normalized it. The .eslintignore
file actually has a list of such files in the *.js realm which fail to be consistent with the rest of the project.
It'd be excting for code quality! |
My life was hell in 2020, and I'm still dealing with the aftermath. Saw this because of noctis's comment. The code coverage parts sound really cool (I never knew how to do those). The linting part, as you know, I don't like. A few of the rules you picked out tho I'm in favor of, but given how much hell, stress, depression, etc. I'm recovering from, and impossible deadlines in multiple areas of my life, this is a "let's try it after mymore basic goals have been completed/finished." Is there a way to get the code coverage without linting? Thanks! |
@amark I feel like we are in a similar boat. Been overworked since the last time we chatted in Discord, which was when I created this. As requested I broke out the code coverage, and editor config files, into separate PRs that the maintainers can comment and amend. 👍🏻 That being said I put quite alot of time into getting an eslint config that actually works with this codebase, so I hope that you will reconsider. Auto formatting and the errors in the IDE are a massive productivity boost, and to be honest quite integral to my dev workflow. |
Sorry to hear that :( as well. Been gone at bunch of conferences this last month, sorry for the delay. Thanks for splitting things up. Which / how / teach me the parts on the code coverage? |
So just to clarify, its not about forcing a coding standard down on you ~ #227
To justify why I feel linting would assist this project:
But most important, so I will stipulate this separately. Linting is essential for code review!
Also this project has files which do not parse as valid JavaScript, currently
npm run lint
actually returns errors that have nothing to do with styling.
And you will find this is the most forgiving/allowing code linting rules in any project.
I have actually disabled the majority of the linting rules so that you can opt-in rather
than deal with the massive task of bringing this to up to date with best practices.
Also I see you have massive branches you need to merge so...
That being said I feel there are some rules which are disabled that as I said are essential imho
I am happy to take a phased approach at this point, without linting I feel like I am
walking drunk into an African brothel without a condom 🤪
This will effect your development workflow, with the addition of the
pre-commit
andpre-push
git hooks. You should enableeditorconfig
andeslint
plugins in your IDEto guide you to not have issues when it comes time to commit or push.