Skip to content

Doesn't work correctly with package.json trick #1033

Closed
@arnsa

Description

@arnsa

Hello,

so in my project I am using this little neat trick with package.json file. Let's say I have images folder and inside that folder I have a package.json file with only one line: { "name":"images" }. That way, I can use imports like this:

import MarkerImage from 'images/marker.png';

And it will work just fine. The problem is that eslint-plugin-import that it's unable to resolve path module and also that "images" should be listed in the project's dependencies. Is there any way to fix this without disabling these rules?

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