Giter VIP home page Giter VIP logo

Comments (11)

bradzacher avatar bradzacher commented on June 7, 2024 1

Hard to say much of anything without some information. Would need a repro to be able to provide any advice.

Though the reported error message isn't one of ours.

from eslint-plugin-import.

ljharb avatar ljharb commented on June 7, 2024

We don't yet support v6 of the TS eslint parser (meaning, we don't test on it).

from eslint-plugin-import.

MillerSvt avatar MillerSvt commented on June 7, 2024

Do you have any plans?

from eslint-plugin-import.

JounQin avatar JounQin commented on June 7, 2024

I believe @bradzacher is more suitable to answer the question.

from eslint-plugin-import.

ljharb avatar ljharb commented on June 7, 2024

I suspect this error comes from tsconfig-paths; it’s not one of ours either.

from eslint-plugin-import.

MillerSvt avatar MillerSvt commented on June 7, 2024

Reproduce repo
This is a cleaned up version of our config.
Before the update to typescript-eslint/parser@6, everything worked fine.


If I comment these lines eslint-module-utils/parser.js

  delete parserOptions.EXPERIMENTAL_useProjectService;
  delete parserOptions.project;
  delete parserOptions.projects;

Everything also worked fine.

from eslint-plugin-import.

ljharb avatar ljharb commented on June 7, 2024

To fix this, we'll need to start testing on v6 of the TS eslint parser.

from eslint-plugin-import.

bradzacher avatar bradzacher commented on June 7, 2024

errorOnTypeScriptSyntacticAndSemanticIssues: true,

I had forgotten that even existed. I didn't know people used it - it's literally tge first time I've ever seen it used.

Turn that off and it'll work.

from eslint-plugin-import.

MillerSvt avatar MillerSvt commented on June 7, 2024

This is a common standard for our company, I'll ask if we can disable it.

But in any case, do you think this is normal behavior?

from eslint-plugin-import.

bradzacher avatar bradzacher commented on June 7, 2024

Yes. The behaviour of deleting the parser options is intended (and implemented by me).
eslint-plugin-import does its own out-of-band parsing so it can analyse exports of dependencies. To do this is uses your configured parser.

If we leave those parser options behind then it means that when import/ attempts to parse a dependency it will cause our parser to attempt to do a type-aware parse. If the file isn't part of a project (eg it's in node_modules) then this causes REALLY REALLY REALLY BAD BEHAVIOUR such as crashes or CRAZY BAD slowness (as you noted - #1408)

When I added those deletes 5 years ago I didn't remember errorOnTypeScriptSyntacticAndSemanticIssues existed.
In v6 we changed the underlying infra so that that option requires type information.

It's an undocumented parser option and shouldn't actually work within eslint anyways. We'll look at removing it entirely (filed typescript-eslint/typescript-eslint#8681).

You should delete it from your eslint config.

from eslint-plugin-import.

MillerSvt avatar MillerSvt commented on June 7, 2024

Got it, thanks!

from eslint-plugin-import.

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.