-
Notifications
You must be signed in to change notification settings - Fork 348
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
Project wide editorconfig lint #224
Project wide editorconfig lint #224
Conversation
Why moving away from XO? |
We are not! |
Oops. My bad! 😅 |
90782e6
to
3b36572
Compare
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.
I think this is good to merge, I haven't run any tests locally since it should all be visual. My comment is for general discussion, not blocking 😊
@@ -63,7 +64,12 @@ | |||
}, | |||
"lint-staged": { |
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.
General question: is this absolutely required? I know there are lots of repos that do this, but (for me personally) it wastes a lot of time because I have to wait for lint to run until I can commit + push to remotes and it makes me not want to commit because there's too much friction
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.
I agree. I would prefer a pre-push hook rather than pre-commit
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.
With CI, failing lint prevents merge
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.
But CI is after pushing changes, right? And CI evaluates the last commit.
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.
Something like this: https://github.com/theenadayalank/lint-prepush?
I'll have to drop the --fix
option if we go that way as it does not support creating a lint-fix commit. Push will fail if lint is not OK.
The lint-staged
task runs really fast on my computer, is it slow for you? I think keeping the lint-fixes within the commit is better but if you guys want to ditch it, we can.
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.
Why can't we just do this:
"pre-push": "npm run lint:fix"
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.
If the task returns without errors (even if it linted some files, unstaged so), it will continue to push without creating a fix commit.
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.
Oh, okay, I understand.
I'll have to drop the --fix option if we go that way as it does not support creating a lint-fix commit. Push will fail if lint is not OK.
I'm fine with this. But if we decide to continue with the pre-commit hook, I'm fine with that too 😄
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.
The
lint-staged
task runs really fast on my computer, is it slow for you?
Yep, adds 3-5 seconds, even though I have an ssd 😭
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.
I usually see projects checking for linting errors only on CI. If you decide on going in this route, I think it's preferable to have linting done automatically on push instead of on every commit, since the latter makes the entire iteration process slower and more annoying.
Regarding creating a lint-fix
commit automatically on push / commit, that doesn't seem like a good idea to me, since many times I've had auto-fixable linting errors which I needed to fix manually as that was more appropriate.
These are just my opinions and observations from working on other projects though.
250a42c
to
526555a
Compare
Can I merge this? |
👍 |
Use https://github.com/jedmao/eclint to check and fix lint respecting rules from
.editorconfig
file.Added to the lint-staged pipeline.
LICENSE
is set to be ignored as it does not respect any rules, we can also add a specific rule for it instead of ignoring it.