Skip to content

definitions-parser has fatal crash for nearly-correct header #28

@sandersn

Description

@sandersn

This crash brought down both CI and publishing, which should not happen. It might not be the fault of the parser.

// Type definitions for non-npm package css-typed-object-model-level-1 20180410.0
// Project: https://www.w3.org/TR/css-typed-om-1/
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.9

With the error

Error: At 2:50 : Expected one of
        /(, )|(,?\r?\n\/\/\s\s+)/
        /\r?\n\/\/ Definitions by: /

The corrected header is:

// Type definitions for non-npm package css-typed-object-model-level-1 20180410.0
// Project: https://www.w3.org/TR/css-typed-om-1/
// Definitions by: Nathan Shively-Sanders <https://github.com/sandersn>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.9

See the breaking PR here: DefinitelyTyped/DefinitelyTyped#45076
and the fix commit here: DefinitelyTyped/DefinitelyTyped@f64a42d

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions