Code Monkey home page Code Monkey logo

Comments (14)

mgol avatar mgol commented on July 1, 2024 4

I've reported an issue upstream that would help for this & similar use cases: eslint/eslint#7021 (and that would expose a proper API instead of having to hack into the internal ESLint package structure).

from eslint-find-rules.

ljharb avatar ljharb commented on July 1, 2024 2

I would be happy to accept that PR on eslint-plugin-react. eslint-plugin-import has some deprecated rules as well, iirc.

from eslint-find-rules.

randycoulman avatar randycoulman commented on July 1, 2024 1

I'll try to work on a PR on eslint-plugin-react, but it might be a week or so before I can get to it. If anyone else wants to do it before then, feel free.

eslint-plugin-import just added its first deprecated rule in 2.0, but it's really just a rename of one rule to another, and it doesn't warn about the deprecated name when running it. I'll look at submitting a PR for that as well at my next opportunity.

from eslint-find-rules.

mgol avatar mgol commented on July 1, 2024 1

The ESLint PR has landed; I created an issue to switch to the new API: #211. Once that's done, this issue should be easily solvable.

from eslint-find-rules.

jfmengels avatar jfmengels commented on July 1, 2024

👍 I like the idea, and ESLint does return enough data to handle that (see this)

From what I can see, it could work for plugin rules too, if we're careful with the format of the rule (ESLint v2 and v3 format), and if they copy the same meta info behavior as ESLint.

The only downside to this, is that you'd need to require all core rules to find out whether they're deprecated, which would make the tool quite a lot slower I'm guessing, but it could be done only if needed, when the right flags are activated (if requiring all those rules is indeed that slow).

from eslint-find-rules.

ta2edchimp avatar ta2edchimp commented on July 1, 2024

👍 making the tool slower is worth it in this case, I guess! At least, when being behind a flag.

from eslint-find-rules.

mateatslc avatar mateatslc commented on July 1, 2024

look here for news on this: eslint/eslint#6525

from eslint-find-rules.

randycoulman avatar randycoulman commented on July 1, 2024

I looked into doing this at one point and I really love the idea of having this feature.

From my earlier research, I only found one plugin that had deprecated rules (eslint-plugin-react), and it doesn't add a deprecated flag to the metadata. Instead, it exports a deprecatedRules property alongside its rules property.

It might be worth doing a couple of things:

  1. Submit a PR to eslint-plugin-react to add the deprecated property to its rule metadata.
  2. Update the ESLint plugin documentation to recommend doing that in all plugins.

Does anyone know of any other plugins that have deprecated rules? What do they do?

from eslint-find-rules.

mvolkmann avatar mvolkmann commented on July 1, 2024

An example of a rule that is deprecated, but is flagged by eslint-find-rules as being unused is react/no-comment-textnodes.

from eslint-find-rules.

alexilyaev avatar alexilyaev commented on July 1, 2024

@mgol @randycoulman Can we push this forward?
I see there's a PR that requires a review.

Or is there anything else missing?

from eslint-find-rules.

randycoulman avatar randycoulman commented on July 1, 2024

We can't do anything here until #237 has been merged. Once that's done, we'll have to refactor a bit to use the new API to get the full rule definitions (we only use the rule names right now). Then we can filter out the deprecated rules.

from eslint-find-rules.

ntwb avatar ntwb commented on July 1, 2024

Looking forward to this 😄

from eslint-find-rules.

randycoulman avatar randycoulman commented on July 1, 2024

Now that #237 has been merged, this can be started. I plan to get to it as soon as I can, but I'm a bit busy right now and it might be a week before I get to it. If someone else wants to run with it, go for it - just let me know so I don't duplicate effort.

from eslint-find-rules.

ljharb avatar ljharb commented on July 1, 2024

It'd be good to cut a major release before merging this new option, imo.

from eslint-find-rules.

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.