Giter Site home page Giter Site logo

Comments (5)

jimmed avatar jimmed commented on May 27, 2024 1

I'm also experiencing this issue in a private repo. I'm happy to provide more context as needed.

The issue is presenting in two different ways:

  1. Without import type

    import { SomeTypeOrInterface } from "some-module";
    /path/to/my/app/file.tsx
    Error:   1:1  error  Type import "SomeTypeOrInterface" is used by decorator metadata  @typescript-eslint/consistent-type-imports
    
  2. With import type

    import type { SomeTypeOrInterface } from "some-module";
    /path/to/my/app/file.tsx
    Error:   1:1  error  All imports in the declaration are only used as types. Use `import type`  @typescript-eslint/consistent-type-imports
    

Naturally, I would expect the use of import type to be valid when importing a TS type or interface.

from jsx-ast-utils.

jimmed avatar jimmed commented on May 27, 2024 1

@jimmed thanks! unfortunately our tests currently can't parse import type syntax. Is that the only cases where you're seeing "TSNonNullExpression could not be resolved"?

Sorry for the delayed response - this fell off my radar. It looks like the TSNonNullExpression warning was completely unrelated to the issue I had (which appears fixed)

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024

What version of jsx-ast-utils do you have installed?

Do you happen to know what code you're linting that causes this error?

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024

@jimmed thanks! unfortunately our tests currently can't parse import type syntax. Is that the only cases where you're seeing "TSNonNullExpression could not be resolved"?

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024

I wonder if #129 may fix this? I'm going to close it, and if the next release doesn't fix it (or if @feeduraddiction can provide repro info) then I'm happy to reopen it.

from jsx-ast-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.