Andrey Shaposhnikov
Andrey Shaposhnikov

Reputation: 23

1 linter (TS-Standard) throw different errors depends from the launch folder

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:

enter image description here

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 don't have anything related to settings of it (both using default lib and config).

What I expected to happen

I don't get errors on linter checks.

What seems to have happened

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

Please provide your dependency tree as an attachment unless not applicable. Feel free to omit sensitive information.

First of all, i don't have any linter files with settings (they using all by default, and i am fine with that). Nor in tsconfigs, nor in eslint.configs, i just dont have it.

Here is MAIN deps:

MAIN

Here is CD -> web folder (front-end):

WEB

What i did about it

I was trying to configure configs, tsconfigs. The issue is, i can cure this by only disable /web fully from linting (which is incorrect and not a solution), but i didnt finded out the info on internet | YT out there, to somehow force this 2 commands works the same as they should i think.

Upvotes: 0

Views: 27

Answers (0)

Related Questions