Giter VIP home page Giter VIP logo

Comments (4)

pierpo avatar pierpo commented on August 12, 2024 2

Seems relevant 😊
Thank you for your answer.

Actually, it turns out you can directly test on ASTExplorer an ESLint rule!
If you click on "Transform" above then ESLint you'll see the code for your rule and you can put your ESQuery there.

image

So, problem solved and nothing needs to be done 😊

Thank you!

image

from esquery.

brettz9 avatar brettz9 commented on August 12, 2024 1

I personally really like this idea. However, I think it might be better to get esquery filtering supported in ASTExplorer itself, as that already has robust options and display (I mentioned this in an offhand comment at fkling/astexplorer#483 already, but deserves its own issue I think).

from esquery.

karlhorky avatar karlhorky commented on August 12, 2024 1

Thanks for the tip @pierpo ! Although I couldn't copy out of the screenshot so easily 😬

Here's a new snippet based off of the technique in the screenshot for anyone else who wants to copy + paste into AST explorer:

export default function (context) {
  return {
    "JSXElement[openingElement.name.name='p'] > JSXElement[openingElement.name.name=/^span$/]": (
      node
    ) => {
      context.report({
        node,
        message: "Found"
      });
    }
  };
}

On AST explorer: https://astexplorer.net/#/gist/4699a2ceadc890386cbd0727734c3ca5/c9250ace00e2686b4d95879dff67341ce35d9018

Screenshot 2023-04-18 at 12 42 44

from esquery.

brettz9 avatar brettz9 commented on August 12, 2024 1

I should note that if that is ESLint v 4, then it is a different and I believe forked version of esquery, even while it may remain mostly the same.

from esquery.

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.