Skip to content

[ESLint] CodeFactor does not see issues with non-existing import #65

Closed
@Jxlle

Description

@Jxlle

We are currently running CodeFactor as well as a GitHub action linter on our repository PR's to be sure that none of the two have problems. A recent PR gave issues on our linter action, but not on CodeFactor.

One of the rulesets that we use is the @typescript-eslint strict ruleset. It does not allow unsafe assignments (assignments of an any value).

Consider the following example scenario based on our observations:

  • nonExistingObject did exist in the test file in a previous version, but was removed in the version that is now checked by CodeFactor. The import and usage of the object has not been removed.
import { nonExistingObject } from ./test;

const obj = nonExistingObject;

This code is wrong because it uses a non-existing import. However, there is a discrepancy between the result of the linter action and CodeFactor. CodeFactor sees no issues, but the linter gives the following error:

Unsafe assignment of an any value (@typescript-eslint/no-unsafe-assignment)

which seems to be a fitting error as the object does not exist anymore, so TypeScript cannot infer a type.

Can this be fixed?

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