Skip to content

chore: [IOPLT-1738] Migrate from eslint to oxlint - #7989

Draft
dmnplb wants to merge 13 commits into
masterfrom
IOPLT-1738-migrate-to-oxlint
Draft

chore: [IOPLT-1738] Migrate from eslint to oxlint#7989
dmnplb wants to merge 13 commits into
masterfrom
IOPLT-1738-migrate-to-oxlint

Conversation

@dmnplb

@dmnplb dmnplb commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Note

Don't merge this PR until the official nx plugin is available. For more info, please refer to:

Short description

Migrate from eslint from oxlint with almost full compatibility.

Caution

The custom i18n-no-unused-keys rule is not ported: it lints locales/it/index.json through a custom ESLint parser, which oxlint's JS plugin bridge doesn't support (yet).

List of changes proposed in this pull request

  • Drop one-var rule to remove compat layer

Dependencies

How to test

Describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

@dmnplb
dmnplb changed the base branch from master to IOPLT-1739-migrate-to-eslint9-flatconfig April 3, 2026 14:37
@dmnplb
dmnplb changed the base branch from IOPLT-1739-migrate-to-eslint9-flatconfig to master April 3, 2026 14:39
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Jira Pull Request Link

This Pull Request refers to Jira issues:

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

PR Title Validation for conventional commit type

All good! PR title follows the conventional commit type.

@codecov

codecov Bot commented Apr 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.87%. Comparing base (af3f694) to head (d714a21).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7989      +/-   ##
==========================================
+ Coverage   62.85%   62.87%   +0.01%     
==========================================
  Files        1963     1963              
  Lines       37210    37210              
  Branches     6277     6277              
==========================================
+ Hits        23389    23395       +6     
+ Misses      12436    12432       -4     
+ Partials     1385     1383       -2     
Files with missing lines Coverage Δ
apps/main-app/ts/api/content.ts 30.76% <ø> (ø)
apps/main-app/ts/api/pagopa.ts 24.75% <ø> (ø)
...pps/main-app/ts/boot/configureStoreAndPersistor.ts 31.19% <ø> (ø)
.../ts/common/context/DSExperimentalContext/index.tsx 28.57% <ø> (ø)
...-app/ts/common/context/DSTypefaceContext/index.tsx 28.57% <ø> (ø)
apps/main-app/ts/common/model/RemoteValue.ts 93.54% <ø> (ø)
...s/common/versionInfo/store/reducers/versionInfo.ts 100.00% <ø> (ø)
apps/main-app/ts/components/AnimatedImage.tsx 83.33% <ø> (ø)
...n-app/ts/components/BonusCard/BonusCardCounter.tsx 85.00% <ø> (ø)
.../main-app/ts/components/CalendarsListContainer.tsx 4.76% <ø> (ø)
... and 243 more

... and 429 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af3f694...d714a21. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dmnplb added 13 commits June 25, 2026 11:42
…to-oxlint

# Conflicts:
#	apps/main-app/package.json
#	apps/main-app/scripts/ts/checkOutdatedDependencies/types/GroupBySeverity.ts
#	apps/main-app/scripts/ts/checkOutdatedDependencies/types/GroupByType.ts
#	apps/main-app/ts/RootContainer.tsx
#	apps/main-app/ts/components/BonusCard/BonusCardCounter.tsx
#	apps/main-app/ts/components/Carousel.tsx
#	apps/main-app/ts/components/IOMarkdown/renderRules.tsx
#	apps/main-app/ts/features/authentication/common/utils/login.ts
#	apps/main-app/ts/features/authentication/login/cie/screens/CieLoginConfigScreen.tsx
#	apps/main-app/ts/features/authentication/login/cie/screens/CieWrongCiePinScreen.tsx
#	apps/main-app/ts/features/authentication/login/cie/store/actions/cie.ts
#	apps/main-app/ts/features/barcode/components/BarcodeScanBaseScreenComponent.tsx
#	apps/main-app/ts/features/barcode/hooks/useIOBarcodeCameraScanner.tsx
#	apps/main-app/ts/features/barcode/hooks/useIOBarcodeFileReader.tsx
#	apps/main-app/ts/features/barcode/screens/BarcodeScanScreen.tsx
#	apps/main-app/ts/features/bonus/cgn/saga/networking/eyca/activation/getEycaActivationSaga.ts
#	apps/main-app/ts/features/bonus/cgn/saga/orchestration/eyca/eycaActivationSaga.ts
#	apps/main-app/ts/features/bonus/cgn/types/DiscountBucketCodeResponse.ts
#	apps/main-app/ts/features/common/components/cie/CieCardReadContent.tsx
#	apps/main-app/ts/features/connectivity/saga/index.ts
#	apps/main-app/ts/features/design-system/components/DSIconViewerBox.tsx
#	apps/main-app/ts/features/fci/saga/index.ts
#	apps/main-app/ts/features/fci/screens/valid/FciDocumentsScreen.tsx
#	apps/main-app/ts/features/fci/store/actions/index.ts
#	apps/main-app/ts/features/fci/store/reducers/fciSecurityLevelReducer.ts
#	apps/main-app/ts/features/idpay/configuration/components/IdPayInstrumentEnrollmentSwitch.tsx
#	apps/main-app/ts/features/idpay/onboarding/machine/actors.ts
#	apps/main-app/ts/features/ingress/saga/index.ts
#	apps/main-app/ts/features/itwallet/analytics/saga/credentialAnalyticsHandlers.ts
#	apps/main-app/ts/features/itwallet/analytics/utils/types.ts
#	apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/config.ts
#	apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/index.tsx
#	apps/main-app/ts/features/itwallet/common/components/ItwEidLifecycleAlert.tsx
#	apps/main-app/ts/features/itwallet/common/components/ItwRetryableQRCode.tsx
#	apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/types.ts
#	apps/main-app/ts/features/itwallet/common/components/PoweredByItWalletText.tsx
#	apps/main-app/ts/features/itwallet/common/saga/environment.ts
#	apps/main-app/ts/features/itwallet/common/saga/offlineAccess.ts
#	apps/main-app/ts/features/itwallet/common/utils/ItwCodecUtils.ts
#	apps/main-app/ts/features/itwallet/common/utils/constants.ts
#	apps/main-app/ts/features/itwallet/common/utils/itwClaimsUtils.ts
#	apps/main-app/ts/features/itwallet/common/utils/itwCredentialIssuanceUtils.ts
#	apps/main-app/ts/features/itwallet/common/utils/itwMocksUtils.ts
#	apps/main-app/ts/features/itwallet/common/utils/itwTypesUtils.ts
#	apps/main-app/ts/features/itwallet/identification/cie/hooks/useCieManager.tsx
#	apps/main-app/ts/features/itwallet/identification/cieId/hooks/useCieIdApp.ts
#	apps/main-app/ts/features/itwallet/lifecycle/saga/checkWalletInstanceStateSaga.ts
#	apps/main-app/ts/features/itwallet/machine/credential/context.ts
#	apps/main-app/ts/features/itwallet/machine/credential/failure.ts
#	apps/main-app/ts/features/itwallet/machine/credential/selectors.ts
#	apps/main-app/ts/features/itwallet/machine/eid/__tests__/machine.test.ts
#	apps/main-app/ts/features/itwallet/machine/eid/context.ts
#	apps/main-app/ts/features/itwallet/machine/eid/failure.ts
#	apps/main-app/ts/features/itwallet/machine/upgrade/context.ts
#	apps/main-app/ts/features/itwallet/machine/upgrade/input.ts
#	apps/main-app/ts/features/itwallet/presentation/common/components/ItwClaimsSelector/index.tsx
#	apps/main-app/ts/features/itwallet/presentation/proximity/machine/context.ts
#	apps/main-app/ts/features/itwallet/presentation/proximity/machine/failure.ts
#	apps/main-app/ts/features/itwallet/presentation/proximity/utils/errors.ts
#	apps/main-app/ts/features/itwallet/presentation/proximity/utils/types.ts
#	apps/main-app/ts/features/itwallet/presentation/remote/machine/context.ts
#	apps/main-app/ts/features/itwallet/presentation/remote/machine/failure.ts
#	apps/main-app/ts/features/itwallet/presentation/remote/utils/itwRemoteTypeUtils.ts
#	apps/main-app/ts/features/itwallet/statusList/saga/index.ts
#	apps/main-app/ts/features/itwallet/statusList/tasks/index.ts
#	apps/main-app/ts/features/itwallet/statusList/utils/storage.ts
#	apps/main-app/ts/features/itwallet/trustmark/machine/context.ts
#	apps/main-app/ts/features/itwallet/walletInstance/store/reducers/index.ts
#	apps/main-app/ts/features/lollipop/httpSignature/signature.ts
#	apps/main-app/ts/features/lollipop/index.ts
#	apps/main-app/ts/features/lollipop/saga/index.ts
#	apps/main-app/ts/features/lollipop/store/reducers/lollipop.ts
#	apps/main-app/ts/features/lollipop/utils/fetch.ts
#	apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsHeader.tsx
#	apps/main-app/ts/features/messages/saga/handleClearAttachments.ts
#	apps/main-app/ts/features/messages/saga/handleUpsertMessageStatusAttributes.ts
#	apps/main-app/ts/features/messages/store/reducers/allPaginated/types.ts
#	apps/main-app/ts/features/messages/types/index.ts
#	apps/main-app/ts/features/payments/receipts/store/actions/index.ts
#	apps/main-app/ts/features/pn/hooks/__tests__/usePnPreferencesFetcher.test.tsx
#	apps/main-app/ts/features/services/common/components/ListItemSearchInstitution.tsx
#	apps/main-app/ts/features/services/details/types/ServicePreferenceResponse.ts
#	apps/main-app/ts/features/settings/common/sagas/profile.ts
#	apps/main-app/ts/features/settings/preferences/screens/EmailForwardingScreen.tsx
#	apps/main-app/ts/features/settings/userData/shared/screens/EmailValidationSendEmailScreen.tsx
#	apps/main-app/ts/features/wallet/saga/handleWalletAnalyticsSaga.ts
#	apps/main-app/ts/features/wallet/types/index.ts
#	apps/main-app/ts/hooks/useStatusAlertProps.tsx
#	apps/main-app/ts/sagas/contentLoaders.ts
#	apps/main-app/ts/sagas/mixpanel.ts
#	apps/main-app/ts/sagas/workUnit/index.ts
#	apps/main-app/ts/store/actions/application.ts
#	apps/main-app/ts/store/reducers/persistedPreferences.ts
#	apps/main-app/ts/store/reducers/search.ts
#	apps/main-app/ts/types/helpers.ts
#	apps/main-app/ts/types/pagopa.ts
#	apps/main-app/ts/types/utils.ts
#	apps/main-app/ts/utils/SessionManager.ts
#	apps/main-app/ts/utils/analytics.ts
#	apps/main-app/ts/utils/brightness.ts
#	apps/main-app/ts/utils/calendar.ts
#	apps/main-app/ts/utils/dates.ts
#	apps/main-app/ts/utils/fetch.ts
#	apps/main-app/ts/utils/keychain.ts
#	apps/main-app/ts/utils/locale.ts
#	apps/main-app/ts/utils/profile.ts
#	apps/main-app/ts/utils/reporters.ts
#	apps/main-app/ts/utils/strings.ts
#	eslint.config.mjs
#	package.json
#	pnpm-lock.yaml
…Plugins

Load eslint-plugin-perfectionist through oxlint's jsPlugins (oxlint has no
native perfectionist rules) and enable a high-value subset in natural
order: sort-imports, sort-named-imports, sort-jsx-props, sort-interfaces,
sort-object-types, sort-union-types, sort-enums. sort-objects stays off,
matching master, since its auto-fix corrupts multi-line values.

The codebase already complies, so this adds enforcement without churn.
…to-oxlint

# Conflicts:
#	apps/main-app/package.json
#	apps/main-app/ts/features/messages/store/reducers/__tests__/messagePrecondition.test.ts
…to-oxlint

Ports the lint rules master added in the meantime to the oxlint config:
`no-dynamic-delete`, `no-misused-promises`, `strict-boolean-expressions`,
`react/jsx-no-constructed-context-values` and the custom `i18n-no-dynamic-keys`
rule. The local ESLint plugin now hosts more than one rule, so it is exposed as
`eslint-plugin-io-app` with an index aggregating the rules.

Master's `i18n-no-unused-keys` rule is not ported: it lints `locales/it/index.json`
through a custom ESLint parser, which oxlint's JS plugin bridge does not support.
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.

1 participant