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

comma-spacing and space-before-function-paren are conflict in type #707

Closed
Austaras opened this issue Jul 16, 2019 · 5 comments
Closed

comma-spacing and space-before-function-paren are conflict in type #707

Austaras opened this issue Jul 16, 2019 · 5 comments
Labels
enhancement: new base rule extension New base rule extension required to handle a TS specific case good first issue Good for newcomers package: parser Issues related to @typescript-eslint/parser

Comments

@Austaras
Copy link
Contributor

Austaras commented Jul 16, 2019

Don't know what's the root cause of this problem, I guess it's the parser

What code were you trying to parse?

function x<R extends Record<string, (this: any) => any>>(fns: R) {
    return fns
}

when eslint config includes

"comma-spacing": "warn",
"space-before-function-paren": ["warn", "never"],

What did you expect to happen?
code shall pass lint

What actually happened?
code violates rule comma-spacing when

function x<R extends Record<string,(this: any) => any>>(fns: R) {
    return fns
}

and violates space-before-function-paren when

function x<R extends Record<string, (this: any) => any>>(fns: R) {
    return fns
}

Versions

package version
@typescript-eslint/parser 1.12.0
TypeScript 3.5.3
ESLint 6.0.2
@Austaras Austaras added package: parser Issues related to @typescript-eslint/parser triage Waiting for maintainers to take a look labels Jul 16, 2019
@bradzacher bradzacher added bug Something isn't working enhancement: new base rule extension New base rule extension required to handle a TS specific case and removed triage Waiting for maintainers to take a look labels Jul 16, 2019
@bradzacher
Copy link
Member

Same issue as in #364, except it's a different rule.

@Austaras
Copy link
Contributor Author

well, thanks for the explanation, hop it will get fixed soon

@bradzacher bradzacher added the has pr there is a PR raised to close this label Aug 30, 2019
@bradzacher bradzacher added good first issue Good for newcomers and removed has pr there is a PR raised to close this bug Something isn't working labels Nov 13, 2019
@bradzacher bradzacher reopened this Nov 18, 2019
@bradzacher
Copy link
Member

comma-spacing has not been fixed yet

@Austaras
Copy link
Contributor Author

IMO comma-spacing doesn't need a fix since generic parameters are supposed to have a space after comma(like prettier does) so as you said this rule "just work"

@bradzacher
Copy link
Member

sounds good!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: new base rule extension New base rule extension required to handle a TS specific case good first issue Good for newcomers package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

No branches or pull requests

2 participants