standard / ts-standard

Typescript style guide, linter, and formatter using StandardJS
https://www.npmjs.com/package/ts-standard
MIT License
473 stars 36 forks source link

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

Open MagisterUnivers opened 1 month ago

MagisterUnivers commented 1 month ago

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?