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

front: enable import/no-extraneous-dependencies lint #10707

Merged
merged 6 commits into from
Feb 7, 2025

Conversation

emersion
Copy link
Member

@emersion emersion commented Feb 6, 2025

This is a valuable lint to figure out cases where we're missing a
dependency (and only get it by chance because another dependency
pulls it in).

See individual commits.

@emersion emersion self-assigned this Feb 6, 2025
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Feb 6, 2025
@emersion emersion marked this pull request as ready for review February 6, 2025 12:18
@emersion emersion requested a review from a team as a code owner February 6, 2025 12:18
@emersion emersion requested review from Synar and clarani February 6, 2025 13:04
Copy link
Contributor

@Synar Synar left a comment

Choose a reason for hiding this comment

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

Overall nice changes, just a couple small issues.

(Perhaps it would be a good idea to have a short meeting at some point to more generally review and update the linting rules we are using)

Don't use the .tsx file extension, because there's no JSX in there.
While at it, use .spec.ts instead of .test.ts since it's the more
widely used suffix.

Signed-off-by: Simon Ser <[email protected]>
We don't use moment anywhere.

Signed-off-by: Simon Ser <[email protected]>
This is the pattern used everywhere else.

Signed-off-by: Simon Ser <[email protected]>
fail() is a jest-ism. We need to use assert.fail() with vitest.

Fixes the following error when @types/jest is dropped:

    /home/simon/src/osrd/front/src/common/IntervalsDataViz/data.spec.ts
      272:9  warning  Unsafe call of a(n) `error` type typed value  @typescript-eslint/no-unsafe-call
      287:9  warning  Unsafe call of a(n) `error` type typed value  @typescript-eslint/no-unsafe-call
      302:9  warning  Unsafe call of a(n) `error` type typed value  @typescript-eslint/no-unsafe-call

Signed-off-by: Simon Ser <[email protected]>
We use vitest for testing, not jest. Remove all remaining references
to jest.

Signed-off-by: Simon Ser <[email protected]>
This is a valuable lint to figure out cases where we're missing a
dependency (and only get it by chance because another dependency
pulls it in).

Signed-off-by: Simon Ser <[email protected]>
@emersion emersion force-pushed the emr/import-no-extra-deps branch from 219cd85 to 52f6d6d Compare February 6, 2025 16:17
@emersion emersion requested a review from Synar February 6, 2025 16:17
Copy link
Contributor

@Synar Synar left a comment

Choose a reason for hiding this comment

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

LGTM ^^

Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this PR 🙏

@emersion emersion added this pull request to the merge queue Feb 7, 2025
Merged via the queue into dev with commit b443b6a Feb 7, 2025
27 checks passed
@emersion emersion deleted the emr/import-no-extra-deps branch February 7, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants