FCE-3072: Fix lint: use typescript import resolver in mobile-client eslint config#512
Conversation
Co-authored-by: milosz.filimowski <milosz.filimowski@swmansion.com>
The expo ESLint config enables import/no-unresolved via plugin:import/errors, but the import resolver cannot resolve yarn workspace packages like @fishjam-cloud/react-client and @fishjam-cloud/ts-client. This is the same approach used in the fishjam-chat example. Co-authored-by: milosz.filimowski <milosz.filimowski@swmansion.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the mobile-client ESLint configuration to address lint failures caused by import/no-unresolved not resolving Yarn workspace package imports under the expo ESLint preset.
Changes:
- Disable
import/no-unresolvedinpackages/mobile-client/.eslintrcto unblockyarn lint:check.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The expo ESLint config enables import/no-unresolved via plugin:import/errors, but the default node resolver cannot resolve yarn workspace packages like @fishjam-cloud/react-client and @fishjam-cloud/ts-client. Instead of disabling the rule, configure eslint-import-resolver-typescript which can follow workspace package references through tsconfig and package.json exports. Co-authored-by: milosz.filimowski <milosz.filimowski@swmansion.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…le-client Co-authored-by: milosz.filimowski <milosz.filimowski@swmansion.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Fix the broken
yarn lint:checkby configuring the TypeScript import resolver in themobile-clientpackage's ESLint configuration.The
expoESLint config (extended bymobile-client/.eslintrc) enablesimport/no-unresolvedviaplugin:import/errors. The defaultnoderesolver cannot resolve yarn workspace packages like@fishjam-cloud/react-clientand@fishjam-cloud/ts-client, causing 4 lint errors:Instead of disabling
import/no-unresolvedentirely, the fix:eslint-import-resolver-typescriptas a direct devDependency ofmobile-clientso it's always available regardless of hoisting..eslintrcsettings so the resolver can follow workspace package references throughtsconfig.jsonandpackage.jsonexports.This keeps
import/no-unresolvedactive to catch real unresolved imports.Motivation and Context
The
yarn lint:checkwas failing in themobile-clientworkspace due to theexpoESLint config bringing in theimport/no-unresolvedrule which the default node resolver cannot handle for workspace package imports.Documentation impact
Types of changes
not work as expected)