Comments (13)
This should be fixed by 1.4.2
. Please confirm.
from esquery.
We are facing this too
from esquery.
Same issue here.
As workaround, on the top app level I install the older version:
npm install --save-dev [email protected]
from esquery.
same problem with my eslint config
from esquery.
This should be fixed by
1.4.2
. Please confirm.
It works for me
from esquery.
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.
@michaelficarra Upgrading to 1.4.2
solved the issue for me.
from esquery.
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.
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.
@michaelficarra Yes, can confirm this issue, and that @binsee's PR #136 is a good fix for it.
from esquery.
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.
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.
Same problem can be fixed by reverting back to version 1.4.0.
from esquery.
Related Issues (20)
- Do not bundle estraverse dependency? HOT 1
- Demo: support for different parsers? HOT 4
- Support back-references with wildcards
- Crash on optional chaining HOT 3
- Feature Request: Add support for custom visitor keys. HOT 2
- Change match order to avoid inefficient comparisons HOT 1
- Question: How can I match a specific child of a parent? HOT 1
- Proposal: Support check types HOT 3
- `:has(selector)` matches nodes matched by `selector` HOT 1
- TypeError: esquery.parse is not a function
- Attribute value doesn't support empty array ([]) HOT 1
- Feature Request: Add `:is` as alias for `:matches`
- Building esquery using sample code
- Array selector HOT 7
- Python port
- :has(> child) is not supported HOT 4
- how to use esquery with ts-morph? HOT 2
- Help with array null child selector HOT 3
- Feature Request: Add a method for converting a selector object to a string HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esquery.