Giter VIP home page Giter VIP logo

Comments (13)

michaelficarra avatar michaelficarra commented on August 12, 2024 20

This should be fixed by 1.4.2. Please confirm.

from esquery.

bmnidhin avatar bmnidhin commented on August 12, 2024 10

We are facing this too

from esquery.

stheine avatar stheine commented on August 12, 2024 7

Same issue here.
As workaround, on the top app level I install the older version:
npm install --save-dev [email protected]

from esquery.

markchristianlacap avatar markchristianlacap commented on August 12, 2024 4

same problem with my eslint config

from esquery.

davorpa avatar davorpa commented on August 12, 2024 3

This should be fixed by 1.4.2. Please confirm.

It works for me

from esquery.

binsee avatar binsee commented on August 12, 2024 2

same problem

  • output
> [email protected] lint:es
> eslint --ignore-pattern fixtures/ "src/**/*.ts" "tests/**/*.ts"

Oops! Something went wrong! :(

ESLint: 8.34.0

TypeError: Cannot read properties of undefined (reading 'type')
Occurred while linting /Users/binsee/code/file-box/src/config.ts:1
    at /Users/binsee/code/file-box/node_modules/esquery/dist/esquery.min.js:1:29496
    at /Users/binsee/code/file-box/node_modules/esquery/dist/esquery.min.js:1:30539
    at Function.b.matches (/Users/binsee/code/file-box/node_modules/esquery/dist/esquery.min.js:1:34875)
    at NodeEventGenerator.applySelector (/Users/binsee/code/file-box/node_modules/eslint/lib/linter/node-event-generator.js:296:21)
    at NodeEventGenerator.applySelectors (/Users/binsee/code/file-box/node_modules/eslint/lib/linter/node-event-generator.js:324:22)
    at NodeEventGenerator.enterNode (/Users/binsee/code/file-box/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (/Users/binsee/code/file-box/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
    at /Users/binsee/code/file-box/node_modules/eslint/lib/linter/linter.js:1153:32
    at Array.forEach (<anonymous>)
    at runRules (/Users/binsee/code/file-box/node_modules/eslint/lib/linter/linter.js:1148:15)
  • package-lock.json
    "node_modules/esquery": {
      "version": "1.4.1",
      "resolved": "https://registry.npmmirror.com/esquery/-/esquery-1.4.1.tgz",
      "integrity": "sha512-3ZggxvMv5EEY1ssUVyHSVt0oPreyBfbUi1XikJVfjFiBeBDLdrb0IWoDiEwqT/2sUQi0TGaWtFhOGDD8RTpXgQ==",
      "dev": true,
      "dependencies": {
        "estraverse": "^5.1.0"
      },
      "engines": {
        "node": ">=0.10"
      }
    },

from esquery.

aarongerig avatar aarongerig commented on August 12, 2024 2

@michaelficarra Upgrading to 1.4.2 solved the issue for me.

from esquery.

Silvea12 avatar Silvea12 commented on August 12, 2024

Got it affecting a number of modules, including the @typescript-eslint/require-await rule from https://github.com/typescript-eslint/typescript-eslint, as seen in typescript-eslint/typescript-eslint#6477

For anyone looking for a quick/temporary fix, run npm install --save-dev --save-exact [email protected] to force the working 1.4.0 version to install. An npm upgrade will break it again, so just re-run it to re-download 1.4.0 until a fixed 1.4.2 is released.

from esquery.

bradzacher avatar bradzacher commented on August 12, 2024

A mocha test case for the repo which should pass, but fails in the latest version

    it("child not", function () {
        const program = {
            type: "Program",
            body: [
                {
                    type: "VariableDeclaration",
                    declarations: [
                        {
                            type: "VariableDeclarator",
                            id: { type: "Identifier", name: "x" },
                            init: { type: "Literal", value: 1, raw: "1" },
                        },
                    ],
                    kind: "var",
                },
            ],
        };
        const matches = esquery(program, "VariableDeclarator[init] > *");

        assert.includeMembers(matches, [
            program.body[0].declarations[0].id,
            program.body[0].declarations[0].init,
        ]);
    });

Running this test against the v1.4.0 tag passes.
Bisecting I think this was introduced in 44e1ff5 (this PR - #134) cc @jviide

from esquery.

jviide avatar jviide commented on August 12, 2024

@michaelficarra Yes, can confirm this issue, and that @binsee's PR #136 is a good fix for it.

from esquery.

andreassjoberg avatar andreassjoberg commented on August 12, 2024

Same issue here. As workaround, on the top app level I install the older version: npm install --save-dev [email protected]

You can also add to your package.json:

  "overrides": {
    "esquery": "1.4.0"
  },

from esquery.

sezanzeb avatar sezanzeb commented on August 12, 2024

In yarn, you can use resolutions in your package.json file

    "resolutions": {
        "eslint/esquery": "1.4.0"
    },

afterwards, run yarn. I think this is a better workaround than adding a fixed esquery version as a dependency of your project.

from esquery.

tentone avatar tentone commented on August 12, 2024

Same problem can be fixed by reverting back to version 1.4.0.

bug

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.