Skip to content

Function type aliases not considered in valid-title and prefer-describe-function-title #692

@FloEdelmann

Description

@FloEdelmann

Consider this code:

// validator.ts
export type Validator = () => boolean

export const validator1: Validator = () => true
export const validator2: Validator = () => true
// validator.spec.ts
import { validator1 } from './validator.ts'

describe('validator1', () => {  })
describe(validator2, () => {  })

With typecheck: true, no prefer-describe-function-title error is reported for 'validator1', although I would have expected it to suggest using validator1 as the title instead. With typecheck: false (default), prefer-describe-function-title reports an error as expected.

In either case, valid-title reports an error for validator2, telling me that validator2 is not a valid title, although it is a function and thus should be supported.

CC @JoshuaKGoldberg as the rule author (#690)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions