Code Monkey home page Code Monkey logo

Comments (12)

Jelmerro avatar Jelmerro commented on July 18, 2024 3

From the comments on your linked issue it actually seems like this eslint-plugin-etc package should be using ts-api-utils instead of the outdated tsutils package, there is not going to be a new version of tsutils published, ts-api-utils IS the new version made by the eslint team. I was planning to make a PR, but it seems like the entire stack of *etc is based on tsutils, so I'll leave you to update this, but I did want to inform you about this development in that issue.

from eslint-plugin-etc.

cartant avatar cartant commented on July 18, 2024 3

Thanks for reading that issue's comments more thoroughly than I did, @Jelmerro. I'll take a look at ts-api-utils to see what'll be involved in getting things upgraded.

from eslint-plugin-etc.

cartant avatar cartant commented on July 18, 2024 2

I've taken a look at this. Fixing this is not straightforward, as the error is being effected from a dep that's pretty deep down:

ajafff/tsutils#156

A lot of these lint rules rely on tsutils, so this is likely to remain a problem until it's fixed in that package and a new version is published.

from eslint-plugin-etc.

DoubleJ-G avatar DoubleJ-G commented on July 18, 2024

Also got an error on

Error while loading rule 'etc/no-internal': Cannot read properties of undefined (reading 'text')

Appears to happen on TS 5.2 and 5.3

from eslint-plugin-etc.

ekilah avatar ekilah commented on July 18, 2024

I was doing a TS 5.2 upgrade today and saw this issue. However, I wasn't seeing any problem on TS 5.2 in my own project, which doesn't configure eslint-plugin-etc to do anything but the default.

i.e. all I do in .eslintrc.js is this:

plugins: [
  // other plugins
  'etc'
]

Curious what the repro steps are for an issue? For example, do I need code that breaks a certain rule, or a certain rule enabled, to see an issue?

I am on version 2.0.2 if that makes a difference.

from eslint-plugin-etc.

AndreaPontrandolfo avatar AndreaPontrandolfo commented on July 18, 2024

Curious what the repro steps are for an issue? For example, do I need code that breaks a certain rule, or a certain rule enabled, to see an issue?

Can you share the full configuration? Because of course, if you not enabling ANY eslint-plugin-etc rules, you are not gonna see any errors.

from eslint-plugin-etc.

ekilah avatar ekilah commented on July 18, 2024

You may have missed my edit above, I have since added my config :)

from eslint-plugin-etc.

AndreaPontrandolfo avatar AndreaPontrandolfo commented on July 18, 2024

You may have missed my edit above, I have since added my config :)

I mean the whole file.

from eslint-plugin-etc.

ekilah avatar ekilah commented on July 18, 2024

I use lots of lint configs, so I won't post the whole thing, but the only other relevant part of the file (to eslint-plugin-etc) is the config for one of the rules:

'etc/no-implicit-any-catch': ['error', {allowExplicitAny: false}],

Otherwise, the plugin bit above should mean that I'm using the recommended rule set, I believe:

https://github.com/cartant/eslint-plugin-etc/blob/e04da45c70d404177a11294ed3891cc85aaf4def/source/configs/recommended.ts

but maybe that's not how it works 🤔

from eslint-plugin-etc.

ekilah avatar ekilah commented on July 18, 2024

Ah, right, I forgot, that is indeed not how it works. I don't have

extends: ["plugin:etc/recommended"],

so i guess I'll amend my previous statement: It seems like this one rule etc/no-implicit-any-catch works fine on TS 5.2 from my limited tests :)

from eslint-plugin-etc.

nirtamir2 avatar nirtamir2 commented on July 18, 2024

I have the same issue of #64 (comment)
I specifically for:

type AnyObject = Record<string, unknown>;

// HERE IS THE LINE THAT BREAK
function pick<T extends AnyObject, K extends keyof T>(
  obj: T,
  keys: Array<K>
): Pick<T, K> {
  const picked: Partial<Pick<T, K>> = {};

  for (const key of keys) {
    if (key in obj) {
      picked[key] = obj[key];
    }
  }

  return picked as Pick<T, K>;
}

and the rule that breaks is "etc/no-misused-generics": "error",

from eslint-plugin-etc.

CHE1RON avatar CHE1RON commented on July 18, 2024

Any news on this? 😉

from eslint-plugin-etc.

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.