-
Notifications
You must be signed in to change notification settings - Fork 464
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
lint: add eslint based on config-semistandard #1067
lint: add eslint based on config-semistandard #1067
Conversation
Hello, @mhdawson need your help for review this, thank you for your guidance 😀 |
@rubiagatra I'm not sure that gets us semitstandard. These two files might be a good example: https://github.com/pkgjs/support/blob/main/.eslintrc.json |
What you have in the PR in the following line is probably better than the example as I can see how it tries to run only on what is changed, but I think we'd want it to report issues versus just fixing them (which is what I assume the --fix option is for). Maybe we want 2 targets one to report issues which is run as part of building/testing and checking in, and a separate one which can be used to run the --fix targer.
Also to clarify as part of " run apply as part of adding, list steps to generate lint changes" we want to fix all files so the linter won't complain and the validate that in the following step so that after we finish this issue we have all code complying with the linter. |
thank you for your feedback! @mhdawson recently I updated for some changes
the workflow
I already using pretest on my local it resulted
|
@rubiagatra, I think the pre-test should use the same logic as the other targets so that it only runs on files that have changed. In terms of running the linter and adding the changed files I'm thinking we should run the --fix target and let it fix what can be automatically fixed and add that to this PR as a separate commit. For the const/let versus var then doing those in followup PRs would make sense as for this first step we were thinking we'd just include changes which were purely mechanical. Since linter will only run on changed files it should be ok to only fix a subset of the reported issues. |
I explain the latest changes @mhdawson
so we can compare the remote main branch with the current PR commit, reference https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches also, add
as your request for pre-commit on the local machine, it will run thanks! |
Signed-off-by: Michael Dawson <mdawson@devrus.com>
@rubiagatra I pushed a commit with a few tweaks, I think to make it a bit more consistent with what we did on the c++ side. It runs the linter before running the tests and you have to run the fix target specifically to have it fix automatically for you. I think that with that commit it likely no longer needs the changes to the ci related files (and probably explains why they fail). Could you take a look and see if you agree and if so remove the changes to the ci reils? |
@rubiagatra I also noticed that for the C formatting, if the are upstaged files with lint issues it will warn:
I wonder if we can get the same behaviour for js files? |
I run several commits to understand how the ci works, I think these are the takeaways from it.
I think that's the scope of this PR, what do you think @mhdawson ? (All the checks also passed right now) |
@rubiagatra I think its now in a good shape. I don't think it covers "run apply as part of adding, list steps to generate lint changes" so I unchecked that but I think we could do that in a separate PR. It would be running the fix and committing those changes but that might make good smaller PR's versus one bigger one anyway since in some cases it needs changes beyond what the fix can resolve. As you say improving so that we get a better message from eslint could be in a follow-on PR. |
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.
LGTM
* lint: add eslint based on config-semistandard
* lint: add eslint based on config-semistandard
Closes #1063
PR approach
Todo