Skip to content

ESLint Warning n/no-missing-import #1428

@danielpeintner

Description

@danielpeintner

With #1424 we introduced some new eslint warnings.

One warning is n/no-missing-import

// relax missing import rule to warning, as we sometimes have optional dependencies
// import "../foo" will braise a warning ,
// import "../foo.js" is the correct way to import a file that may not exist
"n/no-missing-import": "warn",

Which shows for normal imports like

import { ContentCodec } from "../content-serdes";

Image

To fix it (as the comment above alludes), one needs to change

import { ContentCodec } from "../content-serdes";

to

import { ContentCodec } from "../content-serdes.js";

Do we really want to do that? I think it works but to me, it looks somewhat silly in a TS project to reference JS files?

Opinions?

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