Skip to content

e18e.configs is possibly undefined when in type-checked eslint config files #67

@serhalp

Description

@serhalp
eslint.config.js:48:3 - error ts(18048): 'e18e.configs' is possibly 'undefined'.
  48   e18e.configs.recommended,

The default export is typed as ESLint.Plugin, which means configs is Record<string, ...> | undefined. This forces users who use TypeScript in their eslint configs to work around the "possibly-undefined" e18e.configs property that is actually always an object:

From what I can tell, other eslint plugins avoid this by exporting more specific types for their configs property. Internally I noticed this also manifests as a ! non-null assertion in src/main.ts.

(PR incoming)

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