{"ecosystem":"npm","package":"eslint-visitor-keys","version":null,"bugs":[{"id":265,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":null,"fixed_version":null,"bug_id":"github:428","title":"`Keyword` tokens output as `Identifier`","description":"Running this small example through astexplorer\r\n```js\r\nasync function *foo() {        // async === Identifier ################\r\n                               // function === Keyword\r\n  var a;                       // var === Keyword\r\n  let b;                       // let === Keyword\r\n  const c = {                  // const === Keyword\r\n    get d() {},                // get === Identifier ################\r\n    set e(val) {},             // set === Identifier ################\r\n  }\r\n  await f;                     // await === Identifier ################\r\n  yield g;                     // yield === Keyword\r\n  typeof x;                    // typeof === Keyword\r\n  a in x;                      // in === Keyword\r\n}\r\n\r\nclass H {                      // class === Keyword\r\n  static i() {}                // static === Keyword\r\n}\r\n\r\nif (true) {} else {}           // if === Keyword\r\n                               // else === Keyword \r\ntry {} catch {} finally {}     // try === Keyword\r\n                               // catch === Keyword\r\n                               // finally === Keyword\r\nfor (;;) {}                    // for === Keyword\r\ndo { } while (true);           // do === Keyword\r\n                               // while === Keyword\r\nfor (let x of y) {}            // for === Keyword\r\n                               // of === Identifier ################\r\n```\r\n[repl](https://astexplorer.net/#/gist/64a872691c918f615302c6f6735ff84e/9229e8f142352a7aba92132bc44a22535bb640cb)\r\n\r\nIt looks like there are a few keywords which are incorrectly parsed as identifiers instead of keywords. I found:\r\n- `async`\r\n- `await`\r\n- `get`\r\n- `set`\r\n- `of`","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/428","labels":["bug","evaluating","blocked"],"created_at":"2026-04-19T04:30:50.943862+00:00","updated_at":"2026-04-19T04:30:50.943862+00:00"},{"id":264,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":null,"fixed_version":null,"bug_id":"github:665","title":"Question: how come function references on the global scope are not closed","description":"https://github.com/eslint/eslint-scope/blob/dbddf14d5771b21b5da704213e4508c660ca1c64/tests/references.js#L211-L263\r\n\r\nI'm working on trying to understand this codebase better.\r\nBut I can't understand why it works this way:\r\n\r\n```js\r\nfunction a() {}\r\na();\r\n```\r\n\r\nTo me it seems clear that the reference that's created as part of the call should resolve directly to the function declaration, but it's not - it remains as an unresolved reference that's added to the global scope's `through` list.\r\n\r\nThis would cause the `no-unused-vars` ESLint rule to error on the function declaration, were it not for [this code](https://github.com/eslint/eslint/blob/015edf6467e33c67b904db037a674d71957a6865/lib/linter/linter.js#L172-L194) in the linter.\r\n\r\nIt looks like it works seemingly by chance? ESLint augments the global scope with more variables, and then forcefully resolves any `through` references against the global variable `set`, which includes the function declaration as well as the augmented variables.\r\n\r\nIs anyone able to explain why this works this way?\r\n\r\nOr a better question - when closing the global scope, why doesn't it attempt to resolve all `through` references against the variables defined in the global scope?","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/665","labels":["bug","accepted","breaking","repro:yes"],"created_at":"2026-04-19T04:30:50.943223+00:00","updated_at":"2026-04-19T04:30:50.943223+00:00"},{"id":263,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":null,"fixed_version":null,"bug_id":"github:470","title":"Should throw on invaid `(a = 1) = t`","description":"This should be invalid.\r\n\r\n```text\r\nrequire(\"espree\").parse('(a = 1) = 2', {sourceType: 'module', ecmaVersion: 2019}).body[0].expression\r\nNode {\r\n  type: 'AssignmentExpression',\r\n  start: 0,\r\n  end: 11,\r\n  operator: '=',\r\n  left: Node {\r\n    type: 'AssignmentPattern',\r\n    start: 1,\r\n    end: 6,\r\n    left: Node { type: 'Identifier', start: 1, end: 2, name: 'a' },\r\n    right: Node { type: 'Literal', start: 5, end: 6, value: 1, raw: '1' }\r\n  },\r\n  right: Node { type: 'Literal', start: 10, end: 11, value: 2, raw: '2' }\r\n}\r\n```","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/470","labels":["bug","accepted"],"created_at":"2026-04-19T04:30:50.942670+00:00","updated_at":"2026-04-19T04:30:50.942670+00:00"},{"id":262,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":null,"fixed_version":null,"bug_id":"github:472","title":"Should throw on `async () => await 5 ** 6;`","description":"`espree` parse this as `await (5 ** 6)`\r\n\r\n```text\r\nrequire('espree').parse('async () => await 5 ** 6', {ecmaVersion: 2017}).body[0].expression.body\r\nNode {\r\n  type: 'AwaitExpression',\r\n  start: 12,\r\n  end: 24,\r\n  argument: Node {\r\n    type: 'BinaryExpression',\r\n    start: 18,\r\n    end: 24,\r\n    left: Node { type: 'Literal', start: 18, end: 19, value: 5, raw: '5' },\r\n    operator: '**',\r\n    right: Node { type: 'Literal', start: 23, end: 24, value: 6, raw: '6' }\r\n  }\r\n}\r\n````\r\n\r\nIn chrome, this is a syntax error\r\n\r\n```js\r\nasync () => await 5 ** 6\r\nVM40:1 Uncaught SyntaxError: Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence\r\n```\r\n\r\n\r\nBabel PR babel/babel#12441","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/472","labels":["bug","accepted","dependency"],"created_at":"2026-04-19T04:30:50.942166+00:00","updated_at":"2026-04-19T04:30:50.942166+00:00"},{"id":261,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":"7.3.1","fixed_version":null,"bug_id":"github:480","title":"npm v7: peer mocha@\">=1.18 <7\" from leche@2.3.0","description":"when running `npm install` with npm v7.\r\n```bash\r\n➜  espree git:(main) npm i\r\nnpm ERR! code ERESOLVE\r\nnpm ERR! ERESOLVE unable to resolve dependency tree\r\nnpm ERR! \r\nnpm ERR! While resolving: espree@7.3.1\r\nnpm ERR! Found: mocha@8.3.2\r\nnpm ERR! node_modules/mocha\r\nnpm ERR!   dev mocha@\"^8.3.1\" from the root project\r\nnpm ERR! \r\nnpm ERR! Could not resolve dependency:\r\nnpm ERR! peer mocha@\">=1.18 <7\" from leche@2.3.0\r\nnpm ERR! node_modules/leche\r\nnpm ERR!   dev leche@\"^2.3.0\" from the root project\r\nnpm ERR! \r\nnpm ERR! Fix the upstream dependency conflict, or retry\r\nnpm ERR! this command with --force, or --legacy-peer-deps\r\nnpm ERR! to accept an incorrect (and potentially broken) dependency resolution.\r\nnpm ERR! \r\nnpm ERR! See /home/weiran/.npm/eresolve-report.txt for a full report.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR!     /home/weiran/.npm/_logs/2021-04-13T03_23_03_200Z-debug.log\r\n```\r\n\r\nwe have to remove leche(like in the eslint repo) - it has been unmaintained.","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/480","labels":["bug"],"created_at":"2026-04-19T04:30:50.941625+00:00","updated_at":"2026-04-19T04:30:50.941625+00:00"},{"id":260,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":null,"fixed_version":null,"bug_id":"github:531","title":"ChainExpression and others are missing in espree.Syntax","description":"According to #331, the `espree.Syntax` object is supposed to contain all node types supported by Espree. But comparing it with ` espree.VisitorKeys`, the following node types are missing:\r\n\r\n* `ChainExpression`\r\n* `ImportExpression`\r\n*  `JSXFragment`\r\n*  `JSXOpeningFragment`\r\n*  `JSXClosingFragment`\r\n*  `PrivateIdentifier`\r\n*  `PropertyDefinition`\r\n*  `StaticBlock`\r\n\r\n`ExperimentalRestProperty` and `ExperimentalSpreadProperty` are also missing, but this might be intentional.\r\n\r\nFor sure one could derive a list of node types from the keys of `VisitorKeys`, but what's the purpose of the `Syntax` export then? Shouldn't it be used any longer?\r\n","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/531","labels":["bug","accepted"],"created_at":"2026-04-19T04:30:50.941097+00:00","updated_at":"2026-04-19T04:30:50.941097+00:00"},{"id":259,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":"9.5.0","fixed_version":null,"bug_id":"github:566","title":"remove sourcemap url","description":"<img width=\"1440\" alt=\"image\" src=\"https://user-images.githubusercontent.com/41773861/226166008-f3396b2c-c725-4587-af90-123e0174f090.png\">\r\n\r\nversion: espree@9.5.0","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/566","labels":["bug","accepted"],"created_at":"2026-04-19T04:30:50.940542+00:00","updated_at":"2026-04-19T04:30:50.940542+00:00"},{"id":258,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":null,"fixed_version":null,"bug_id":"github:622","title":"Bug: `scope-manager` does not support the `ecmaVersion` option set to \"latest.\"","description":"### Which packages are affected?\n\n- [ ] `espree`\n- [X] `eslint-scope`\n- [ ] `eslint-visitor-keys`\n\n### Environment\n\nNode version: \r\nnpm version: \r\nESLint version:\r\nOperating System:\r\n\n\n### What did you do?\n\nTried to set the ecmaVersion option to `lastest` in the `scope-manager`.\r\n\r\n\n\n### What did you expect to happen?\n\nSince we selected the \"latest\" option, it should recognize the most recent ECMAScript version and support import declarations. \r\n\r\n\n\n### What actually happened?\n\nGot the below error:\r\n\r\n![image](https://github.com/user-attachments/assets/76492e59-ca0b-45d1-9aaf-4ca104b81285)\r\n\r\n```\r\nImportDeclaration should appear when the mode is ES6 and in the module context.\r\n```\r\n\r\nhttps://github.com/eslint/js/blob/91d51d3da4273acaf2523a3b6d23a27a733c13cc/packages/eslint-scope/lib/scope-manager.js#L243\r\nThe above condition becomes false when the `ecmaVersion` option is set to `latest`.\r\n\n\n### Link to Minimal Reproducible Example\n\nhttps://deploy-preview-31--eslint-code-explorer.netlify.app/\n\n### Participation\n\n- [X] I am willing to submit a pull request for this issue.\n\n### Additional comments\n\n\r\nIn [Espree](https://github.com/eslint/js/tree/main/packages/espree), the `ecmaVersion` option can be set to `\"latest\"` to support the most recent ECMAScript features.\r\nhttps://github.com/eslint/js/blob/91d51d3da4273acaf2523a3b6d23a27a733c13cc/packages/espree/lib/options.js#L50\r\n\r\nShould we maintain consistent handling and options for `ecmaVersion` in both `Espree` and `eslint-scope`?","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/622","labels":["bug","repro:needed"],"created_at":"2026-04-19T04:30:50.939785+00:00","updated_at":"2026-04-19T04:30:50.939785+00:00"},{"id":257,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":"10.8.1","fixed_version":null,"bug_id":"github:625","title":"Bug: `eslint-scope`  requires `assert`","description":"### Which packages are affected?\n\n- [ ] `espree`\n- [x] `eslint-scope`\n- [ ] `eslint-visitor-keys`\n\n### Environment\n\nNode version: v20.16.0\nnpm version: 10.8.1 \nESLint version: 8.57.0\nOperating System: macOS\n\n\n### What did you do?\n\nIn Code Explorer, I aimed to clean up the dependencies by removing unused development and runtime dependencies. I identified the dependencies that were not being used in the repository and then removed them.\n\n### What did you expect to happen?\n\nCode Explorer should work as expected since I removed only the unused dependencies. \n\n### What actually happened?\n\ncode explorer scope view was breaking got the below error:\n![Image](https://github.com/user-attachments/assets/2ee84ea1-ef13-4493-9e88-52e42f7ef1b1)\n\nWhen I reviewed the scope-manager logic in response to the error, I found that it utilizes `assert`.\n\nhttps://github.com/eslint/js/blob/79c6e93ba93b46186ebfac111c94f44ab3b4ee27/packages/eslint-scope/lib/scope-manager.js#L187\n\nAlso `assert` package was intentionally ignored in the config. \nhttps://github.com/eslint/js/blob/79c6e93ba93b46186ebfac111c94f44ab3b4ee27/packages/eslint-scope/rollup.config.js#L3\n\nThis means the `assert` package was intentionally marked as external and is expected to be present in the environment where the package is used. \n\nDo we have a specific reason for marking `assert` as external? There might be cases where `assert` is not available in the environment where the package (scope-manager) is being used.\n\n### Link to Minimal Reproducible Example\n\nhttps://deploy-preview-33--eslint-code-explorer.netlify.app\n\n### Participation\n\n- [x] I am willing to submit a pull request for this issue.\n\n### Additional comments\n\n_No response_","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/625","labels":["bug","accepted","repro:needed"],"created_at":"2026-04-19T04:30:50.939115+00:00","updated_at":"2026-04-19T04:30:50.939115+00:00"},{"id":256,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":"20.13.1","fixed_version":null,"bug_id":"github:630","title":"Bug: Can't install monorepo","description":"### Which packages are affected?\n\n- [ ] `espree`\n- [ ] `eslint-scope`\n- [x] `eslint-visitor-keys`\n\n### Environment\n\nNode version: 20.13.1\nnpm version: 10.4.0\nESLint version: 9.4.0\nOperating System: Windows\n\n\n### What did you do?\n\nCloned the repository and ran `npm install`\n\n### What did you expect to happen?\n\nFor the monorepo to install successfully.\n\n### What actually happened?\n\nI received this error message:\n\n```\nnpm ERR! > eslint-visitor-keys@4.0.0 build:types\nnpm ERR! > tsc\nnpm ERR!\nnpm ERR! ../../node_modules/@types/node/stream/web.d.ts(469,56): error TS1005: '?' expected.\nnpm ERR! tsconfig.json(3,13): error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', \n'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', \n'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref'.\n```\n\n### Link to Minimal Reproducible Example\n\nhttps://github.com/eslint/js\n\n### Participation\n\n- [ ] I am willing to submit a pull request for this issue.\n\n### Additional comments\n\n_No response_","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/630","labels":["bug","accepted","repro:needed"],"created_at":"2026-04-19T04:30:50.938467+00:00","updated_at":"2026-04-19T04:30:50.938467+00:00"},{"id":255,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":"24.1.0","fixed_version":null,"bug_id":"github:655","title":"Bug: Visitor keys for `ExportSpecifier` are not in source code order","description":"### Which packages are affected?\n\n- [ ] `espree`\n- [ ] `eslint-scope`\n- [x] `eslint-visitor-keys`\n\n### Environment\n\nNode version: 24.1.0\nnpm version: 11.3.0\nESLint version: 9.28.0\nOperating System: Mac OS 15.4.1\n\n\n### What did you do?\n\nAs far as I can see, it's not documented anywhere that visitor keys are always in source code order. However, in my opinion it's what a user would naturally expect, and this expectation seems to be confirmed because it's true for every single AST node type... With only one exception: `ExportSpecifier`.\n\n```js\nexport { local as exported };\n```\n\nIn this case, `exported` is visited before `local`:\n\nhttps://github.com/eslint/js/blob/b847f35787d4bf2ec68163f45f3e4dc2d209eee8/packages/eslint-visitor-keys/lib/visitor-keys.js#L102-L105\n\nI have opened this issue as a bug report as I *assume* that this deviation from \"visit in source code order\" rule is an oversight rather than intentional. But there may be some context I am missing.\n\n### What did you expect to happen?\n\n`local` to be visited before `exported`.\n\n### What actually happened?\n\n`exported` is visited before `local` (more like `ImportSpecifier`).\n\n### Link to Minimal Reproducible Example\n\n<skipped>\n\n### Participation\n\n- [x] I am willing to submit a pull request for this issue.\n\n### Additional comments\n\n_No response_","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/655","labels":["bug","accepted","repro:yes"],"created_at":"2026-04-19T04:30:50.937875+00:00","updated_at":"2026-04-19T04:30:50.937875+00:00"},{"id":254,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":"20.18.0","fixed_version":null,"bug_id":"github:659","title":"Bug: New version of `acorn` v8.1.5 breaks build","description":"### Which packages are affected?\n\n- [x] `espree`\n- [ ] `eslint-scope`\n- [ ] `eslint-visitor-keys`\n\n### Environment\n\nNode version: 20.18.0\nnpm version: 10.9.2\nESLint version: HEAD\nOperating System: Windows 11\n\n\n### What did you do?\n\nHello,\n\nCurrently the [CI build is failing](https://github.com/eslint/js/actions/runs/15529797360/job/43716117138) due to the newly released [`acorn` v8.15.0](https://github.com/acornjs/acorn/releases/tag/8.15.0), which was published about 24 hours ago.\n\nI’ve reviewed the changes between [`v8.14.1...v8.15.0`](https://github.com/acornjs/acorn/compare/8.14.1...8.15.0) and identified the source of the issue. Although this release introduces some ES2026 features, I think the bug is not related to those features.\n\nThe problem comes from this change:\n\nhttps://github.com/acornjs/acorn/compare/8.14.1...8.15.0#diff-6a29ed00e92d69844ec35883ec62f4893f40687e70bcd87905757aeaa6fe0af5\n\n![Image](https://github.com/user-attachments/assets/029a7398-3649-4b98-8f4a-32d85a083489)\n\n```diff\n- if (this.tok.type === tt.num && node.raw.charCodeAt(node.raw.length - 1) === 110)\n-     node.bigint = node.raw.slice(0, -1).replace(/_/g, \"\")\n+ if (this.tok.type === tt.num && node.raw.charCodeAt(node.raw.length - 1) === 110)\n+     node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, \"\")\n```\n\nTo reproduce the issue, you can simply reinstall packages (with the latest acorn) and run:\n\n```sh\nnpm run test -w packages/espree\n```\n---\n\nYou can simply reproduce this bug by running `npm run test -w packages/espree` after reinstalling packages with latest `acorn`.\n\n### What did you expect to happen?\n\nWorks as before.\n\n\n### What actually happened?\n\nCaused errors.\n\n### Link to Minimal Reproducible Example\n\nhttps://github.com/eslint/js/actions/runs/15529797360/job/43716117138\n\n### Participation\n\n- [x] I am willing to submit a pull request for this issue.\n\n### Additional comments\n\nI’m not sure whether this should be fixed in `acorn`, or if it would be better to adjust some test cases or logic in `espree` instead.\n","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/659","labels":["bug","accepted","repro:yes"],"created_at":"2026-04-19T04:30:50.937220+00:00","updated_at":"2026-04-19T04:30:50.937220+00:00"},{"id":253,"ecosystem":"npm","package_name":"eslint-visitor-keys","affected_version":"11.6.2","fixed_version":null,"bug_id":"github:719","title":"Bug: ESLint types are incompatiable with `@types/eslint-scope`","description":"### Which packages are affected?\n\n- [ ] `espree`\n- [x] `eslint-scope`\n- [ ] `eslint-visitor-keys`\n\n### Environment\n\nNode version: 24\nnpm version: 11.6.2\nESLint version: 9.39.2\nOperating System: Mac OS 15.5\n\n\n### What did you do?\n\nUsed the return value of `eslintScope.analyze()` as a parameter of `eslint.Scope.ScopeManager` typed value.\n\n### What did you expect to happen?\n\nTypes should be identical\n\n### What actually happened?\n\nTypes are not identical\n\n### Link to Minimal Reproducible Example\n\nhttps://stackblitz.com/edit/node-isht7kjp?file=package.json,src%2Findex.ts\n\n### Participation\n\n- [ ] I am willing to submit a pull request for this issue.\n\n### Additional comments\n\nComing from https://github.com/eslint-community/eslint-plugin-eslint-plugin/issues/575, seems like the type changes are actually a breaking change","severity":"medium","status":"fixed","source":"github_issues","source_url":"https://github.com/eslint/js/issues/719","labels":["bug","repro:yes"],"created_at":"2026-04-19T04:30:50.936104+00:00","updated_at":"2026-04-19T04:30:50.936104+00:00"}],"total":13,"_cache":"miss"}