Skip to content

feat: only report ESLint errors for unresolvable relative Imports #237#238

Merged
rainerhahnekamp merged 1 commit into
softarc-consulting:mainfrom
wolfmanfx:main
Sep 17, 2025
Merged

feat: only report ESLint errors for unresolvable relative Imports #237#238
rainerhahnekamp merged 1 commit into
softarc-consulting:mainfrom
wolfmanfx:main

Conversation

@wolfmanfx

@wolfmanfx wolfmanfx commented Sep 13, 2025

Copy link
Copy Markdown
Collaborator

Change ESLint adapters to report “cannot be resolved” only for relative imports (starting with .), while continuing to track all unresolvable imports internally for data/export.

Why

  • Reverts behavior introduced in 12b5c1e that caused false positives for external libs and Node built-ins.

Notes

  • No dependency changes; zero-dependencies policy upheld.
  • Docs not impacted beyond behavior clarification.

Breaking changes

  • None for consumers relying on CLI export/data.
  • ESLint surfaces fewer unresolvable import errors (only relative ones).

Checklist

  • Unit tests pass: yarn test
  • Lint: yarn lint:all
  • Build: yarn build:all
  • Integration tests: ./run-integration-tests.sh - There is an issues

Summary:

  • Implemented selective ESLint reporting using isRelativeImport.
  • Preserved internal tracking in UnassignedFileInfo/FileInfo.
  • Updated and added tests to reflect the new behavior.

@rainerhahnekamp rainerhahnekamp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Super Murat, just very tiny details. Can you maybe add in the main.ts for angular-iv and angular-i an import to keycloak. With your change you don't to modify anything else and the integration tests should not report that as unresolvable import.

Comment thread packages/core/src/lib/eslint/tests/violates-dependency-rule.spec.ts Outdated
Comment thread packages/core/src/lib/eslint/tests/violates-encapsulation-rule.spec.ts Outdated
Comment thread packages/core/src/lib/util/is-relative-import.ts
@rainerhahnekamp

Copy link
Copy Markdown
Collaborator

Sorry, my fault. The integration tests have actually been upgraded and are now failing because of the new behavior. Murat, do you want to try it and fix them or should I just merge and push the integration test fixes in a separate PR?

@sonarqubecloud

Copy link
Copy Markdown

@wolfmanfx

wolfmanfx commented Sep 15, 2025

Copy link
Copy Markdown
Collaborator Author

@rainerhahnekamp I have removed the assertion for import 'logo.jpg'; as this not a local import we ignore it

@rainerhahnekamp rainerhahnekamp merged commit 22f1b10 into softarc-consulting:main Sep 17, 2025
4 checks passed
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.

3 participants