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

fix(linter): use import to check for secondary entrypoint in angular #9285

Merged
merged 1 commit into from Mar 11, 2022

Conversation

meeroslav
Copy link
Contributor

@meeroslav meeroslav commented Mar 11, 2022

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #8059

Related to nrwl/nx-examples#179

@meeroslav meeroslav added the scope: linter Issues related to Eslint support in Nx label Mar 11, 2022
@meeroslav meeroslav self-assigned this Mar 11, 2022
@nx-cloud
Copy link

nx-cloud bot commented Mar 11, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit 4bad20f. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 7 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Mar 11, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/D3sqkUUt93CdYEtPcb54ViqNeMdq
✅ Preview: Canceled

[Deployment for 4bad20f canceled]

Copy link
Contributor

@Coly010 Coly010 left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@meeroslav meeroslav merged commit 5db394e into nrwl:master Mar 11, 2022
@meeroslav meeroslav deleted the fix/linter-8059 branch March 11, 2022 13:52
@codephobia
Copy link

@meeroslav Am I correct in my assumption that this fix will not work for wildcard paths used for secondary entry points?

@meeroslav
Copy link
Contributor Author

I would expect it to work @codephobia. Do you have a repro that shows otherwise?

@codephobia
Copy link

codephobia commented Aug 19, 2022

@meeroslav The problem I am seeing is if I try to use a wildcard path for any nested folder within the lib I get the relative path error for the secondary entry point. I've got about 50 entry points for components, some of which are using other components as children. I would prefer to avoid putting them in the root folder of the library since there is other things in the library currently (storybook, schematics, docs, etc) and it makes it look like a mess.

Example path:
"@lib-name/*": ["libs/lib-name/some-folder/*/src/index.ts"],

Error:
Projects should use relative imports to import from other files within the same project. Use "./path/to/file" instead of import from "@lib-name/secondary-entry-point".

I can try to make some time today to repro the issue if that helps.

@codephobia
Copy link

@meeroslav I made a repro of the issue and it seems to work as expected. Must be something in the current setup I have, or the fact that we are still on Nx 13.10.5. At least I know that it should work now, just need to figure out what is needed to get there. Repro: https://stackblitz.com/edit/nx-sgjrmx

@codephobia
Copy link

@meeroslav Upon further investigation, I have a feeling that the folder (libs/my-library/some-folder) is not being linted as expected. It seems that if you include the folder in the lintFilePatterns you then start to see the errors I am experiencing in my project. I have updated the repro accordingly. If you go to https://stackblitz.com/edit/nx-sgjrmx and run the command nx run my-library:lint you will see the error I am experiencing.

@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: linter Issues related to Eslint support in Nx
Projects
None yet
3 participants