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

fix(bug#742): fix all eslint line error & warn #776

Merged
merged 3 commits into from
May 15, 2023

Conversation

qingtiantongxie
Copy link
Contributor

What type of PR is this?

fix all error and warn of eslint

What this PR does / why we need it:

easy to read and understand the logic of the code

Which issue(s) this PR fixes:

Fixes #742

Special notes for your reviewer:

for test this branch run the lint command in package.json
and u get the result like

 *  正在执行任务: npm run lint 

> crane-dashboard@0.2.0 lint
> eslint ./src --ext ts,tsx

 *  终端将被任务重用,按任意键关闭。 

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2023-05-11 13:02
Git Version: 9551ac0

Docker Registry

Overview: https://hub.docker.com/u/gocrane

Image Pull Command
crane-agent:pr-776-9551ac0 docker pull gocrane/crane-agent:pr-776-9551ac0
dashboard:pr-776-9551ac0 docker pull gocrane/dashboard:pr-776-9551ac0
metric-adapter:pr-776-9551ac0 docker pull gocrane/metric-adapter:pr-776-9551ac0
craned:pr-776-9551ac0 docker pull gocrane/craned:pr-776-9551ac0

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=gocrane/craned \
                   --set craned.image.tag=pr-776-9551ac0 \
                   --set metricAdapter.image.repository=gocrane/metric-adapter \
                   --set metricAdapter.image.tag=pr-776-9551ac0 \
                   --set craneAgent.image.repository=gocrane/crane-agent \
                   --set craneAgent.image.tag=pr-776-9551ac0 \
                   --set cranedDashboard.image.repository=gocrane/dashboard \
                   --set cranedDashboard.image.tag=pr-776-9551ac0 crane/crane

Coding Registry

Overview: https://finops.coding.net/public-artifacts/gocrane/crane/packages

Image Pull Command
crane-agent:pr-776-9551ac0 docker pull finops-docker.pkg.coding.net/gocrane/crane/crane-agent:pr-776-9551ac0
dashboard:pr-776-9551ac0 docker pull finops-docker.pkg.coding.net/gocrane/crane/dashboard:pr-776-9551ac0
metric-adapter:pr-776-9551ac0 docker pull finops-docker.pkg.coding.net/gocrane/crane/metric-adapter:pr-776-9551ac0
craned:pr-776-9551ac0 docker pull finops-docker.pkg.coding.net/gocrane/crane/craned:pr-776-9551ac0

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=finops-docker.pkg.coding.net/gocrane/crane/craned \
                   --set craned.image.tag=pr-776-9551ac0 \
                   --set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-776-9551ac0 \
                   --set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-776-9551ac0 \
                   --set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-776-9551ac0 crane/crane

Ghcr Registry

Overview: https://github.com/orgs/gocrane/packages?repo_name=crane

Image Pull Command
crane-agent:pr-776-9551ac0 docker pull ghcr.io/gocrane/crane/crane-agent:pr-776-9551ac0
dashboard:pr-776-9551ac0 docker pull ghcr.io/gocrane/crane/dashboard:pr-776-9551ac0
metric-adapter:pr-776-9551ac0 docker pull ghcr.io/gocrane/crane/metric-adapter:pr-776-9551ac0
craned:pr-776-9551ac0 docker pull ghcr.io/gocrane/crane/craned:pr-776-9551ac0

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=ghcr.io/gocrane/crane/craned \
                   --set craned.image.tag=pr-776-9551ac0 \
                   --set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-776-9551ac0 \
                   --set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-776-9551ac0 \
                   --set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-776-9551ac0 crane/crane

@qingtiantongxie
Copy link
Contributor Author

qingtiantongxie commented May 8, 2023

here are some detail changes:

  1. use eslint-plugin-unused-imports plugin to remove all unused imports
  2. add _ prefix to no used vars
  3. comment no used code snippets and function methods
  4. change congfig of eslint in eslintrc.js

@zsnmwy
Copy link
Member

zsnmwy commented May 10, 2023

Thanks for your contribution.


Would you be willing to add the GitHub action for this feature?
I hope the code will be checked by ESLint when the code has been pushed.

You'll be able to follow these resources to complete this job.

https://github.com/marketplace/actions/eslint-action-eslintrc
https://github.com/gocrane/crane/tree/main/.github/workflows

@qmhu
Copy link
Member

qmhu commented May 10, 2023

Thanks for your contribution.

Would you be willing to add the GitHub action for this feature? I hope the code will be checked by ESLint when the code has been pushed.

You'll be able to follow these resources to complete this job.

https://github.com/marketplace/actions/eslint-action-eslintrc https://github.com/gocrane/crane/tree/main/.github/workflows

It would be perfect to also add to github action

@qmhu qmhu added the bootcamp label May 11, 2023
@qingtiantongxie
Copy link
Contributor Author

fine i will try

Copy link
Member

@qmhu qmhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good for me, PTAL @zsnmwy

@zsnmwy
Copy link
Member

zsnmwy commented May 15, 2023

LGTM

@qmhu qmhu merged commit 02f64cc into gocrane:main May 15, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

优化前端代码,使其通过eslint 验证
3 participants