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 lint issues when bumping eslint-plugin-import #1652

Conversation

Kavinjsir
Copy link
Contributor

@Kavinjsir Kavinjsir commented Aug 9, 2023

Which problem is this PR solving?

Description of the changes

  • Update code lines to resolve lint check warnings

How was this change tested?

  • yarn run esilnt

Checklist

@@ -1,4 +1,4 @@
// Copyright (c) 2017 Uber Technologies, Inc.
// Copyright (c) 2023 Uber Technologies, Inc.
Copy link
Member

Choose a reason for hiding this comment

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

why is this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am wondering if we need to keep the year up to date if we have the code lines in the file get updated?
Or do we keep them as origin?

Copy link
Member

Choose a reason for hiding this comment

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

Uber's was the original copyright, new contributions should use "The Jaeger Authors", which you can add as a line above with the current year if you want.

We tend to keep the original year a specific (c) by-line was introduced. I checked with legal once, there wasn't a lot of value in updating the year.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! I'm going to roll back the corresponding change as it is not necessary. Thx for letting me know:)

@Kavinjsir
Copy link
Contributor Author

I think I might miss the point of ci error before. Just realized that unit-test in ci failed by running yarn lint:
https://github.com/jaegertracing/jaeger-ui/actions/runs/5815079038/job/15766674298

It seems we can reproduce the issue locally by removing the --cache flag when running eslint. Let me try resolving them.

@Kavinjsir Kavinjsir changed the title Bump eslint-plugin-import and fix lint warning WIP: Bump eslint-plugin-import and fix lint warning Aug 10, 2023
@Kavinjsir Kavinjsir force-pushed the refactor/apply-latest-eslint-plugin-import branch from 7eb3e68 to 2358668 Compare August 10, 2023 02:31
@Kavinjsir Kavinjsir changed the title WIP: Bump eslint-plugin-import and fix lint warning Bump eslint-plugin-import and fix lint warning Aug 10, 2023
@@ -14,7 +14,7 @@

import Chance from 'chance';

import { getSpanId } from '../selectors/span';
import getSpanId from '../selectors/span';
Copy link
Member

Choose a reason for hiding this comment

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

this is an exceedingly silly selector, is it actually used, or can we delete it?

@@ -13,7 +13,7 @@
// limitations under the License.

import { followsFromRef } from './trace.fixture';
import { getSpanId } from './span';
import getSpanId from './span';
Copy link
Member

Choose a reason for hiding this comment

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

if this is the only place, let's just replace it with span.ID and delete the selector

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good!

@yurishkuro
Copy link
Member

yurishkuro commented Aug 10, 2023

your description links to issues, but does not put the word Fixes or Resolves in front of them. Please update, this way when the PR is merged the issues will be closed (unless it does not resolve them completely, in which case we typically use the format Part of #xxxx).

package.json Outdated
@@ -14,7 +14,7 @@
"eslint": "8.46.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-import": "2.28.0",
Copy link
Member

Choose a reason for hiding this comment

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

once the CI is green, I would prefer to remove the version upgrade and only leave the code changes, then let the dependabot to redo its PR for the actual upgrade.

@Kavinjsir Kavinjsir changed the title Bump eslint-plugin-import and fix lint warning Fix lint issues when bumping eslint-plugin-import Aug 10, 2023
- Update code lines based on lint check, avoid error and warning.
- Remove `getSpanId` which is unnecessary.

Signed-off-by: Tony Jin <kavinjsir@gmail.com>
@Kavinjsir Kavinjsir force-pushed the refactor/apply-latest-eslint-plugin-import branch from 2358668 to 642c8e0 Compare August 10, 2023 13:44
Signed-off-by: Yuri Shkuro <github@ysh.us>
yurishkuro
yurishkuro previously approved these changes Aug 10, 2023
@yurishkuro yurishkuro enabled auto-merge (squash) August 10, 2023 15:20
@yurishkuro
Copy link
Member

@Kavinjsir I removed the upgrade to keep the scope to code changes only, and it fails the CI, can you please check why?

@Kavinjsir
Copy link
Contributor Author

Kavinjsir commented Aug 10, 2023

@Kavinjsir I removed the upgrade to keep the scope to code changes only, and it fails the CI, can you please check why?

@yurishkuro thx for helping with the updates for dep version and pr description!

Let me take a look for the CI. Seems like some deprecated usage from old react, not sure why occurs though..

Make mock `Blob` a class

Signed-off-by: Tony Jin <kavinjsir@gmail.com>
@yurishkuro yurishkuro enabled auto-merge (squash) August 10, 2023 16:59
constructor(text, options) {
this.text = text;
this.options = options;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yurishkuro From my local, it seems like what really brought the unit-test failure is:
Screenshot 2023-08-10 at 12 47 34 PM

(Not sure why it was missed in the CI logs)

For this error above, I think I made a mistake to convert Blob to an arrow function that is not able to call by new.

So I change such global.Blob to an "explicit" class. Assuming this can:

  1. Still resolve the origin lint warning
  2. Attempt to make it clear so satisfy calling by keyword new.

How do you think of this?

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (f402705) 96.01% compared to head (910694c) 96.01%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1652      +/-   ##
==========================================
- Coverage   96.01%   96.01%   -0.01%     
==========================================
  Files         242      241       -1     
  Lines        7559     7558       -1     
  Branches     1984     1984              
==========================================
- Hits         7258     7257       -1     
  Misses        301      301              
Files Changed Coverage Δ
...src/components/TracePage/TraceStatistics/index.tsx 86.86% <ø> (ø)
...components/SearchTracePage/SearchResults/index.tsx 86.15% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yurishkuro yurishkuro merged commit 153ad9f into jaegertracing:main Aug 10, 2023
8 checks passed
@yurishkuro
Copy link
Member

yurishkuro commented Aug 10, 2023

Thanks, @Kavinjsir, the dependabot PR #1609 was successfully merged after these changes.

🎉

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

Successfully merging this pull request may close these issues.

[deps] Help with upgrading eslint-plugin-import
2 participants