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

Same project linter throws diffirent errors depends from launch folder #295

Open
MagisterUnivers opened this issue Sep 26, 2024 · 0 comments

Comments

@MagisterUnivers
Copy link

MagisterUnivers commented Sep 26, 2024

Here's what I did

I have repository. (Main lets call it like that) that have package.json and some configs. WEB / BACKEND folders you know for what.

When i launch npx ts-standard on MAIN (cd web) folder, i have no issues at all

image

But, when i launch it to github (push and test with npx ts-standard) it sees error. How it happens? I was investigating a day, and find out.

If i use cd web (i am in web folder now) and launch npx ts-standard i will get errors test.yml was returning me with gitActions. But, my linter, stylelint and everything i have (visual plugins and my logic says i dont have errors, which is correct - i dont). But web says, for example:

 if (collectionIdIdZodCheck.safeParse(collectionId).success === false) {
      return NextResponse.json({ message: 'CollectionId body parameter should be number.' }, { status: 400 })
    }

:19:9: This expression unnecessarily compares a boolean value to a boolean instead of using it directly. (@typescript-eslint/no-unnecessary-boolean-literal-compare)

Which is not, when you hover on everything, TS see that this is correct, but linter throw error.
If i try to "fix" it in another way, i can just change to this:

 if (!collectionIdIdZodCheck.safeParse(collectionId).success) {
      return NextResponse.json({ message: 'CollectionId body parameter should be number.' }, { status: 400 })
    }

Then, cd-->web checker wont throw error, but instead, MAIN checker now see something incorrect (and my visual standard linters).
Says:

image

Which is super - weird, because i just fixed that in another linter error. And i guess you understand the issue now, i have endless loop.

This both folders have own tsconfig, but they dont have anything related to settings of it (both using default lib and config).

What I expected to happen

I dont get errors on linter checks.

What seems to have happened

Seems like both rules, settings, linter logic whatever there is - cant collize with each other. 1 tell you 1 thing, 2nd is another. And you cant find a point where there is no errors.

Is that me doing something incorrectly, or this is lib feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant