Skip to content

Cannot read property 'forEach' of undefined when iterating html files #2210

@skoblenick

Description

@skoblenick

Linting all files with a global rule results in:

Linting "demo"...
Cannot read property 'forEach' of undefined
Occurred while linting ./apps/demo/src/app/app.component.html:1

I have a sample repo that reproduces the issue here: https://github.com/skoblenick/eslint-plugin-import-issue

I realize I could technically move the plugin into an override that is specific to the .ts files however it shouldn't be necessary when the code could just be more defensive. I could imagine a use case where I may have preprocessor working on imports within a html or template file (like an hbs) and I want them ordered (hence a lint check).

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