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

chore: update eslint-config-i18n to ^1.1.0 #6210

Closed
wants to merge 4 commits into from

Conversation

cngonzalez
Copy link
Member

@cngonzalez cngonzalez commented Apr 4, 2024

Description

I received a request to review a renovabot PR that upped the version of this lint rule to not allow imports from i18next. Since we had those, it required a manual handling of those places where did previously import this.

What to review

I've made the following changes:

  1. An .eslintrc file that ignores this rule in the i18n folder, since it likely makes sense to have that import there.
  2. In core, updates to import the i18n file.
  3. Disabling the rule where ONLY types were being imported. I'm not sure if it makes sense to export those types ourselves -- I'm not sure how much we plan to / want to deviate.
  4. Updating files in structure to import from sanity rather than i18next.
  5. Disabling the rule in tasks and comments -- the team is currently in the process of moving those files, where it would make more sense to do the local file import, as with other files in core. This task is logged in SDX-1230.

Testing

Does it pass our linting rules?

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Apr 4, 2024 4:28pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2024 4:28pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Apr 4, 2024 4:28pm

Copy link

socket-security bot commented Apr 4, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@react-three/[email protected] None +1 4.22 MB isaacmason
npm/@react-three/[email protected] network Transitive: environment +11 27.4 MB gsimone
npm/@react-three/[email protected] environment +3 759 kB codyjasonbennett
npm/@rexxars/[email protected] environment, filesystem 0 4.52 kB rexxars
npm/@rexxars/[email protected] None 0 25.5 kB rexxars
npm/@rexxars/[email protected] None 0 56 kB rexxars
npm/@sanity/[email protected] environment 0 363 kB rexxars
npm/@sanity/[email protected] eval, network +2 4.52 MB sanity-io
npm/@sanity/[email protected] None 0 59.7 kB bjoerge
npm/@sanity/[email protected] None 0 2.51 MB sanity-io
npm/@sanity/[email protected] None 0 171 kB sanity-io
npm/@sanity/[email protected] None 0 533 kB sanity-io
npm/@sanity/[email protected] None +2 280 kB ricokahler
npm/@sanity/[email protected] Transitive: unsafe +11 2.37 MB sanity-io
npm/@sanity/[email protected] None +2 20.9 kB sanity-io
npm/@sanity/[email protected] None 0 5.25 kB rexxars
npm/@sanity/[email protected] environment +7 3.93 MB sanity-io
npm/@sanity/[email protected] None 0 1.27 MB sanity-io
npm/@sanity/[email protected] None 0 166 kB rexxars
npm/@sanity/[email protected] None 0 985 kB sanity-io
npm/@sanity/[email protected] None 0 906 kB sanity-io
npm/@sanity/[email protected] None 0 903 kB sanity-io
npm/@sanity/[email protected] None 0 924 kB sanity-io
npm/@sanity/[email protected] None 0 909 kB sanity-io
npm/@sanity/[email protected] None 0 62 kB sanity-io
npm/@sanity/[email protected] filesystem Transitive: environment, shell, unsafe +12 14 MB stipsan
npm/@sanity/[email protected] None +1 1.16 MB sanity-io
npm/@sanity/[email protected] None +1 1.17 MB sanity-io
npm/@sanity/[email protected] None 0 113 kB sanity-io
npm/@sanity/[email protected] Transitive: environment +1 995 kB sanity-io
npm/@sanity/[email protected] None 0 116 kB bjoerge
npm/@sanity/[email protected] environment 0 73 kB sanity-io
npm/@sanity/[email protected] filesystem Transitive: environment, eval, shell, unsafe +45 32.3 MB sanity-io
npm/@sanity/[email protected] environment 0 747 kB sanity-io
npm/@sanity/[email protected] None +4 4.93 MB sanity-io
npm/@sanity/[email protected] None +1 10.1 kB rexxars
npm/@sanity/[email protected] environment 0 3.55 MB sanity-io
npm/@tanstack/[email protected] Transitive: environment +1 600 kB tannerlinsley
npm/@testing-library/[email protected] None +2 708 kB testing-library-bot
npm/@testing-library/[email protected] environment +5 7.26 MB testing-library-bot
npm/@testing-library/[email protected] Transitive: environment +5 3.46 MB testing-library-bot
npm/@turf/[email protected] None 0 93.6 kB rowanwins
npm/@turf/[email protected] None +4 372 kB deniscarriere
npm/@types/[email protected] None +1 15.1 kB types
npm/@types/[email protected] None 0 5.13 kB types
npm/@types/[email protected] None 0 1.72 kB types
npm/@types/[email protected] None +2 1.92 MB types
npm/@types/[email protected] None 0 11.4 kB types
npm/@types/[email protected] None 0 3.88 kB types
npm/@types/[email protected] None 0 84.1 kB types
npm/@types/[email protected] None 0 6 kB types
npm/@types/[email protected] None +5 76.3 kB types
npm/@types/[email protected] None 0 5.66 kB types
npm/@types/[email protected] None +1 9.65 kB types
npm/@types/[email protected] None 0 4.81 kB types
npm/@types/[email protected] None +5 76.9 kB types
npm/@types/[email protected] None +9 107 kB types
npm/@types/[email protected] None +1 19.1 kB types
npm/@types/[email protected] None +1 73.4 kB types
npm/@types/[email protected] None 0 5.68 kB types
npm/@types/[email protected] None +1 35.8 kB types
npm/@types/[email protected] None 0 862 kB types
npm/@types/[email protected] None 0 2.7 kB types
npm/@types/[email protected] None 0 6.27 kB types
npm/@types/[email protected] None 0 508 B types
npm/@types/[email protected] None 0 20.6 kB types
npm/@types/[email protected] None 0 1.96 MB types
npm/@types/[email protected] None 0 6.05 kB types
npm/@types/[email protected] None 0 2.85 kB types
npm/@types/[email protected] None 0 4.36 kB types
npm/@types/[email protected] None 0 34.9 kB types
npm/@types/[email protected] None 0 5.67 kB types
npm/@types/[email protected] None +1 47 kB types
npm/@types/[email protected] None 0 3.04 kB types
npm/@types/[email protected] None 0 7.5 kB types
npm/@types/[email protected] None 0 2.97 kB types
npm/@types/[email protected] None 0 13.5 kB types
npm/@types/[email protected] None 0 2.86 kB types
npm/@types/[email protected] None 0 3.96 kB types
npm/@types/[email protected] None 0 5.96 kB types
npm/@types/[email protected] None 0 7.85 kB types
npm/@types/[email protected] None 0 29.8 kB types
npm/@types/[email protected] None +2 926 kB types
npm/@types/[email protected] None 0 3.29 kB types
npm/@types/[email protected] None 0 5.2 kB types
npm/@types/[email protected] None 0 6.06 kB types
npm/@types/[email protected] None 0 21.7 kB types
npm/@types/[email protected] None +1 68.8 kB types
npm/@typescript-eslint/[email protected] None +8 5.28 MB jameshenry
npm/@typescript-eslint/[email protected] None +4 1.37 MB jameshenry
npm/@uiw/[email protected] None +4 1.16 MB wcjiang
npm/@vercel/[email protected] filesystem Transitive: eval +1 312 kB vercel-release-bot
npm/@vercel/[email protected] environment, filesystem, shell +2 277 kB vercel-release-bot
npm/@vercel/[email protected] None 0 25.4 kB vercel-release-bot
npm/@vitejs/[email protected] None +2 52.4 kB vitebot

🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link
Contributor

github-actions bot commented Apr 4, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Apr 4, 2024

Component Testing Report Updated Apr 4, 2024 4:32 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 31s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 5s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 25s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 30s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 57s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 59s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 11s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 23s 8 0 1

@@ -9,6 +9,7 @@ import {
} from '@sanity/ui'
import type * as React from 'react'
import {type ComponentProps, forwardRef} from 'react'
//eslint-disable-next-line @sanity/i18n/no-i18next-import -- avoiding a circular import
import {useTranslation} from 'react-i18next'
Copy link
Member Author

Choose a reason for hiding this comment

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

It seems problematic to import from sanity here, and traversing up and down the file tree to get to core also seems problematic at best.

@cngonzalez cngonzalez marked this pull request as ready for review April 4, 2024 16:37
@cngonzalez cngonzalez requested a review from a team April 4, 2024 16:37
@cngonzalez cngonzalez requested a review from a team as a code owner April 4, 2024 16:37
@cngonzalez cngonzalez requested review from sjelfull and ricokahler and removed request for a team April 4, 2024 16:37
@cngonzalez cngonzalez closed this May 3, 2024
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.

1 participant