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

Bug: [space-infix-ops] false positive since version 5.27.0 #5133

Closed
4 tasks done
paztis opened this issue Jun 1, 2022 · 9 comments · Fixed by #5135
Closed
4 tasks done

Bug: [space-infix-ops] false positive since version 5.27.0 #5133

paztis opened this issue Jun 1, 2022 · 9 comments · Fixed by #5135
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look

Comments

@paztis
Copy link

paztis commented Jun 1, 2022

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.7.2&sourceType=module&code=FAOwhgtgpgzgDmAxlABDANgS2QESgMxQG9gUUoAPOAewCcAXFTEeqW-JVASQGV6xWxFAF9go4ABMoidGFqpE1EDEaJ5AqDyjpp9OgC4UYEAE8A3MGCUaDFFI4BXdKtkwYKLTsR7a7kmQxsTW1dOgAKRAdaeRY+DUNA3AIAOl5+VgBKBKwk-FS4wSIUeXookBRI6KhY9KgzEUsyKH4AcxhPUNpDMJV4tByoPDy0jQyUAF4APhQAJWk6CQAeFVpmFoAaNHpVkBbp8dIyCvVWDu9w+gALTBhkxOCvH02egbGp-qDk5rA2jItRIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKWQBwEMBjRAWgEsA7AM3IA9SB7PVDSR66yAGnG0gACAFwCeeFEWjk8Q0inhUhAenzEyVWg2aswAbT7YoiaNEbQeB7FkP9FAZgBMACUXow1AvGSJLEAL6WALp8AX5AA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

namespace sliceDef {
  export interface IState { }
}

declare const createSelector: any;

export default class Selectors {
  sliceSelector(currentState: sliceDef.IState): sliceDef.IState { return currentState; }

  etagsSelector: (state: sliceDef.IState) => Record<string, string> =
    createSelector(this.sliceSelector, (slice) => slice.etags);
}

ESLint Config

{
  "rules": {
    "space-infix-ops": "off",
    "@typescript-eslint/space-infix-ops": [
      "error",
      {
        "int32Hint": false
      }
    ]
  }
}

tsconfig

{
  "compilerOptions": {
    "strictNullChecks": true
  }
}

Expected Result

no error

Actual Result

11:26 error Operator ':' must be spaced @typescript-eslint/space-infix-ops

Additional Info

No response

Versions

package version
@typescript-eslint/eslint-plugin 5.27.0
@typescript-eslint/parser 5.27.0
TypeScript 4.7.2
ESLint 8.16.0
node 16.5.0
@paztis paztis added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jun 1, 2022
@CyanSalt
Copy link

CyanSalt commented Jun 1, 2022

I had the same problem. It looks similar to #5115.

The fix has been merged but the latest tag has not been released yet, so maybe we can use canary tag to solve this problem.

@CyanSalt
Copy link

CyanSalt commented Jun 1, 2022

It looks like the latest alpha release now fixes the problem in most cases, but does not include those cases that contain extends, e.g.

type Foo<T> = T extends { bar: string } ? string : number
                             ^
type Foo<T> = T extends (bar: string) => void ? string : number
                            ^

@armano2
Copy link
Member

armano2 commented Jun 1, 2022

@paztis fixed by #5113, can you check canary 5.27.1-alpha.5

@paztis
Copy link
Author

paztis commented Jun 1, 2022 via email

@bradzacher
Copy link
Member

As mentioned in our root readme
https://github.com/typescript-eslint/typescript-eslint#versioning

@bradzacher
Copy link
Member

Please use the issue search before filing an issue. Closed issues are a must when searching.

@paztis
Copy link
Author

paztis commented Jun 1, 2022

Wait. I just discover this defect yesterday and was thinking it was due to this 2 days ago commit.
Don't say I don't search on issues before posting.

Now even if the defect is closed it is still not released... When is it supposed to be released ?

@armano2
Copy link
Member

armano2 commented Jun 1, 2022

all commits that land on main branch are published to npm as canary/alpha versions, in this case bug for your fix is in 5.27.1-alpha.5 https://www.npmjs.com/package/@typescript-eslint/eslint-plugin?activeTab=versions

as for normal release, we usually have them at beginning of the week (~monday)

@bradzacher
Copy link
Member

When is it supposed to be released ?

This is explained in the link.
https://github.com/typescript-eslint/typescript-eslint#versioning

Armano is correct - canary off every commit, stable every monday morning PST.

@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look
Projects
None yet
4 participants