iTwin / eslint-plugin

MIT License
0 stars 0 forks source link

[needs-triage] is no-internal-report broken in nightly? #45

Closed MichaelBelousov closed 8 months ago

MichaelBelousov commented 1 year ago

seems to emit nothing and the eslint child process exits non-zero unless I remove the custom formatter path, but haven't investigated further.

anmolshres98 commented 8 months ago

@MichaelBelousov I am trying to investigate this and close it. Could you let me know reproduction steps for this please, thanks!

MichaelBelousov commented 8 months ago
  1. Create an empty project with a file that imports e.g. @itwin/core-backend, and used an internal API. I believe the are some on ImodelDb so you can just open a snapshot
  2. Install this package and its peer dependencies e.g. eslint
  3. Run this package's no-internal-report utility, perhaps like pnpm exec no-internal-report was the lint error flagged?
  4. Confirm that running regular eslint flags the issue that the report utility should
anmolshres98 commented 8 months ago

Ok, thanks. I was able to reproduce with following code:

image image image image

openForApplyChangesets() is marked as @internal so this should be erroring but isn't

image

Starting to dig deeper to figure it out now

anmolshres98 commented 8 months ago

Actually, it appears that I had to specify the file to run this lint rule on:

image

I got this output message when I specified the correct file:

image

Could you please tell me how this is normally called by a consumer and what the expected correct outcome would be? Is the expected behavior for the js to throw?

anmolshres98 commented 8 months ago

In addition to above, with this config:

image

running pnpm lint results in the following:

image

plus I was able to see this from VSCode's intellisense as well:

image

I believe this means everything is working as expected. @MichaelBelousov please let me know if that is the case and I will close this issue out. Thanks!

MichaelBelousov commented 8 months ago

perhaps I got confused and imo it's unintuitive, but shouldn't no-internal-report without a file argument just use the current working directory's package.json to lint the whole package?

anmolshres98 commented 8 months ago

Sorry I am fairly new to this so learning as I go too. It seems tho that the call does expect to be provided files argument explicitly:

image

Some usages here: https://github.com/search?q=org%3AiTwin+no-internal-report&type=code

image

On my test pkg when I use the same code and resulting output from the run:

image
MichaelBelousov commented 8 months ago

I think we should close this until I come up with a real reproduction again, thanks! I'll need to dig around for the repo where this didn't work.