Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Nov 10, 2022
2 parents 28c48af + f8014b7 commit 311081c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/eslint-plugin-ow3/src/rules/generic-spacing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ type Foo<
`interface Log {
<T>(name: T): void
}`,
`interface Foo {
foo?: <T>(name: T) => void
}`,
]
const invalids = [
['type Foo<T=true> = T', 'type Foo<T = true> = T'],
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-ow3/src/rules/generic-spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default createEslintRule<Options, MessageIds>({
const sourceCode = context.getSourceCode()
return {
TSTypeParameterDeclaration: (node) => {
if (!['TSCallSignatureDeclaration', 'ArrowFunctionExpression'].includes(node.parent.type)) {
if (!['TSCallSignatureDeclaration', 'ArrowFunctionExpression', 'TSFunctionType'].includes(node.parent.type)) {
const pre = sourceCode.text.slice(0, node.range[0])
const preSpace = pre.match(/(\s+)$/)?.[0]
// strip space before <T>
Expand Down

0 comments on commit 311081c

Please sign in to comment.