Skip to content

import/no-unresolved when trying to import types from @types/* #17

Closed
@manuelbieh

Description

@manuelbieh

I'm trying to use eslint with @typescript-eslint/parser and eslint-plugin-import but no matter what I do, I get an error:

Unable to resolve path to module 'express-serve-static-core'  import/no-unresolved

whenever I try to import types from @types packages.

Looks like the sourceType: 'module' parserOption is causing this error but when I remove it I get another error:

Parsing error: ImportDeclaration should appear when the mode is ES6 and in the module context

I created a minimal example to reproduce this error. Probably it's just a setting that's wrong but I have tried different settings, plugins, parserOptions and what not and I just don't get it working:
https://github.com/manuelbieh/eslint-typescript-import-bug

So I'm not sure if the problem is on my side or if it is a bug in this package.

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