Bump packages to fix linter

This commit is contained in:
Henry Mercer 2023-01-18 20:50:03 +00:00
parent ed9506bbaf
commit 0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions

509
node_modules/espree/CHANGELOG.md generated vendored
View file

@ -1,509 +0,0 @@
v7.3.1 - December 5, 2020
* [`fef6f4a`](https://github.com/eslint/espree/commit/fef6f4a2803d959304c6961527044bd9da39ac92) Upgrade: acorn-jsx@5.3.1 (#459) (Milos Djermanovic)
* [`0e09d9a`](https://github.com/eslint/espree/commit/0e09d9a4f213cb87073a6a87cb7d6317b77d1a23) Chore: Add tests for ecmaVersion default value (#460) (Milos Djermanovic)
* [`4c70052`](https://github.com/eslint/espree/commit/4c70052df0b0ba903602c1f838918cbc07ee5eca) Docs: Fix some minor typos in the READMEs (#455) (Noah Doersing)
v7.3.0 - August 22, 2020
* [`4ba3eef`](https://github.com/eslint/espree/commit/4ba3eefdc4b32784565822b34f11977e99ca1a19) Chore: move to GitHub Actions (#449) (Kai Cataldo)
* [`bd0a405`](https://github.com/eslint/espree/commit/bd0a405ffbe4962bcf5aa225ed3861a6a15cb827) Update: support logical assignment and numeric separators (#448) (Toru Nagashima)
v7.2.0 - July 17, 2020
* [`91c2d58`](https://github.com/eslint/espree/commit/91c2d5896889042058399cd64de4b218c5add0eb) Docs: Add security policy (#447) (Nicholas C. Zakas)
* [`872645c`](https://github.com/eslint/espree/commit/872645cea0bee08960b93c097f84153d44b44d7f) Update: support optional chaining (#446) (Toru Nagashima)
* [`0cc7800`](https://github.com/eslint/espree/commit/0cc78007c933564f32fd849bd8022992845c3ac1) Docs: Clean up LICENSE file (#445) (Nicholas C. Zakas)
v7.1.0 - June 4, 2020
* [`75e80bc`](https://github.com/eslint/espree/commit/75e80bc1b5a100f64b09b2c7bf47c5168417d890) Update: support `??` operator, `import.meta`, and `export * as ns` (#441) (Toru Nagashima)
* [`ad0543c`](https://github.com/eslint/espree/commit/ad0543c8b9f6981857ebebf23a37589a656e61a6) Chore: added fixlint in Makefile.js (#440) (Anix)
v7.0.0 - May 7, 2020
* [`8fe2efc`](https://github.com/eslint/espree/commit/8fe2efc00902e7f1680af00a6279e1aecb3c5b47) Breaking: drop Node v8 support (#429) (Kai Cataldo)
* [`6048bfe`](https://github.com/eslint/espree/commit/6048bfe3939fa7dc162c0b3c4b043bb410736b0b) Docs: documenting public API (fixes #431) (#442) (Anix)
* [`9a4cff3`](https://github.com/eslint/espree/commit/9a4cff3626d50a88428ca1b66610a2bdedd774dd) Chore: added tests for options normalize (#439) (Anix)
* [`99707f3`](https://github.com/eslint/espree/commit/99707f3f9d337ca719dce5720106f98b65bba7b1) Chore: added lockfiles to .gitignore (#438) (Anix)
* [`9b91bcc`](https://github.com/eslint/espree/commit/9b91bccacea15c75025a62bae828f83598aef5fe) Docs: new site for docs (#436) (Anix)
v6.2.1 - March 10, 2020
* [`d6d7480`](https://github.com/eslint/espree/commit/d6d7480e424960159007caea86f209f696138734) Upgrade: acorn 7.1.1, Regex DOS vuln (fixes #435) (#434) (James)
v6.2.0 - March 2, 2020
* [`ced1b68`](https://github.com/eslint/espree/commit/ced1b6810b991531e6d3788ebd5a322fc5c7d463) Update: update acorn-jsx and fix failing test (#432) (Kai Cataldo)
* [`acb8776`](https://github.com/eslint/espree/commit/acb8776d369abf9e02f79142879e9b1a4774f938) Update: add latestEcmaVersion & supportedEcmaVersions (#430) (Kai Cataldo)
v6.1.2 - October 20, 2019
* [`70c4970`](https://github.com/eslint/espree/commit/70c4970e5eba6f060e1e32a22d231647f2d0e0f8) Fix: misuse token types (fixes #393, refs eslint/eslint#11018) (#426) (Toru Nagashima)
v6.1.1 - August 23, 2019
* [`ba81546`](https://github.com/eslint/espree/commit/ba81546e8552ec0f779aae7e03668c334630484e) Upgrade: dev deps to latest (#424) (薛定谔的猫)
* [`bbe0119`](https://github.com/eslint/espree/commit/bbe01195fb57e24634d18825d39b820ed1767e95) Upgrade: acorn-jsx@5.0.2 (#423) (薛定谔的猫)
* [`c0635ba`](https://github.com/eslint/espree/commit/c0635bac4cd891cb612fb81655012e2579f4e2b1) Docs: update readme to mention ES2020 (#422) (Kai Cataldo)
v6.1.0 - August 18, 2019
* [`9870c55`](https://github.com/eslint/espree/commit/9870c553efd3eb1bd22b4b3bb5220896c5cb6933) Update: improve error messaging when validating ecmaVersion (#421) (Kai Cataldo)
* [`3f49224`](https://github.com/eslint/espree/commit/3f49224eb05f6b8cb1b996ce424a99c40978b389) Fix: tokenize the latest right curly brace (fixes #403) (#419) (finico)
* [`f5e58cc`](https://github.com/eslint/espree/commit/f5e58cc5e9030793baca3426366b8d7286ef5b89) Update: support bigint and dynamic import (#415) (Toru Nagashima)
v6.0.0 - June 21, 2019
* [`a988a36`](https://github.com/eslint/espree/commit/a988a36e436a1ab6c84005ba0adb6cf9c262c1ec) Build: add node 12 (#414) (薛定谔的猫)
v6.0.0-alpha.0 - April 12, 2019
* [`493d464`](https://github.com/eslint/espree/commit/493d464e1564aea0ea33000389771d42ddece2cb) Breaking: validate parser options (fixes #384) (#412) (薛定谔的猫)
v5.0.1 - February 15, 2019
* [`c40e2fc`](https://github.com/eslint/espree/commit/c40e2fcedf81ff06151e82bdf655d2d0d29e71b8) Upgrade: acorn@6.0.7 (#407) (Kai Cataldo)
v5.0.0 - December 5, 2018
* [`1bcd563`](https://github.com/eslint/espree/commit/1bcd563d4eb4b4032d2662cc5ccd3bfd841b39d7) Breaking: remove attachComment (#405) (Kai Cataldo)
* [`35623ee`](https://github.com/eslint/espree/commit/35623ee07289c9199eef8b735c97cb3d3d08d5b8) Chore: update linting config (#406) (Kai Cataldo)
* [`4b86a7d`](https://github.com/eslint/espree/commit/4b86a7dc7c447c11bb6530e46dc43428ce2bd372) Build: add node 11 (#400) (薛定谔的猫)
* [`7c278d6`](https://github.com/eslint/espree/commit/7c278d6acc6b5db86b803d0cd21b830deb6f569e) Fix: build failing due to incorrectly super() call (fixes #398) (#399) (薛定谔的猫)
* [`6ebc219`](https://github.com/eslint/espree/commit/6ebc21947166399a0b4918d4a1beb9d610650336) Upgrade: eslint & eslint-config-eslint (#387) (薛定谔的猫)
v4.1.0 - October 24, 2018
* 8eadb88 Upgrade: acorn 6, acorn-jsx 5, and istanbul (#391) (Toru Nagashima)
* 0f2edb8 Upgrade: eslint-release@1.0.0 (#392) (Teddy Katz)
* 560b6f7 Update: VisitorKeys depend on eslint-visitor-keys (#389) (othree)
* 6bf2ebf Docs: Fix some typos in the README (#386) (Hugo Locurcio)
v4.0.0 - June 21, 2018
v4.0.0-rc.0 - June 9, 2018
* d8224c4 Build: Adding rc release script to package.json (#383) (Kevin Partington)
* 4207773 Build: add node 10 (#381) (薛定谔的猫)
* cd9da7e Update: upgrade acorn to support two ES2019 syntax (#380) (Toru Nagashima)
* 8cb3ceb Chore: remove Object.assign polyfill (#382) (薛定谔的猫)
v4.0.0-alpha.1 - May 28, 2018
* 56c5a9c Fix: remove workarounds for acorn < 4 (#372) (Rouven Weßling)
* fd305e5 Upgrade: eslint-release to v0.11.1 (#376) (Teddy Katz)
v4.0.0-alpha.0 - March 30, 2018
* 95fa890 Build: fix typos in package.json release scripts (#375) (Teddy Katz)
* 6284e09 Breaking: remove experimentalObjectRestSpread option (#374) (Teddy Katz)
* 0df063f Breaking: require Node.js 6+, upgrade acorn-jsx@4.1.1 (fixes #345) (#371) (薛定谔的猫)
* 0252144 Upgrade: acorn 5.5.1 (#370) (Rouven Weßling)
v3.5.4 - March 4, 2018
* 706167b Upgrade: acorn 5.5.0 (#369) (Toru Nagashima)
v3.5.3 - February 2, 2018
* 70f9859 Upgrade: acorn 5.4.0 (#367) (Toru Nagashima)
* cea4823 Chore: Adding .gitattributes file (#366) (Kevin Partington)
* 4160aee Upgrade: acorn v5.3.0 (#365) (Toru Nagashima)
v3.5.2 - November 10, 2017
* 019b70a Fix: Remove blockBindings from docs (fixes #307, fixes #339) (#356) (Jan Pilzer)
* b2016cb Chore: refactoring rest/spread properties (#361) (Toru Nagashima)
* 59c9d06 Chore: upgrade acorn@5.2 (fixes #358) (#360) (Toru Nagashima)
* 06c35c9 Chore: add .npmrc (#359) (Toru Nagashima)
v3.5.1 - September 15, 2017
* 5eb1388 Fix: Fix parsing of async keyword-named object methods (#352) (#353) (Mark Banner)
v3.5.0 - August 5, 2017
* 4d442a1 Update: add initial support for ES2018 (#348) (Teddy Katz)
* d4bdcb6 Fix: Make template token objects adhere to token object structure (#343) (Ian Christian Myers)
* 9ac671a Upgrade: acorn to 5.1.1 (#347) (Teddy Katz)
* 16e1fec Docs: Specify default values of options (fixes #325) (#342) (Jan Pilzer)
* be85b8e Fix: async shorthand properties (fixes #340) (#341) (Toru Nagashima)
v3.4.3 - May 5, 2017
* 343590a Fix: add AwaitExpression to espree.Syntax (fixes #331) (#332) (Teddy Katz)
v3.4.2 - April 21, 2017
* c99e436 Upgrade: eslint to 2.13.1 (#328) (Teddy Katz)
* 628cf3a Fix: don't mutate user-provided configs (fixes #329) (#330) (Teddy Katz)
v3.4.1 - March 31, 2017
* a3ae0bd Upgrade: acorn to 5.0.1 (#327) (Teddy Katz)
* 15ef24f Docs: Add badges (#326) (Jan Pilzer)
* 652990a Fix: raise error for trailing commas after rest properties (fixes #310) (#323) (Teddy Katz)
* 9d86ba5 Upgrade: acorn to ^4.0.11 (#317) (Toru Nagashima)
* a3442b5 Chore: fix tests for Node 6+ (#315) (Teddy Katz)
v3.4.0 - February 2, 2017
* f55fa51 Build: Lock acorn to v4.0.4 (#314) (Kai Cataldo)
* 58f75be Fix:generic error for invalid ecmaVersion(fixes eslint#7405) (#303) (Scott Stern)
* d6b383d Docs: Update license copyright (Nicholas C. Zakas)
* e5df542 Update: To support year in ecmaVersion number (fixes #300) (#301) (Gyandeep Singh)
v3.3.2 - September 29, 2016
* 7d3e2fc Fix: reset `isAsync` flag for each property (fixes #298) (#299) (Toru Nagashima)
v3.3.1 - September 26, 2016
* 80abdce Fix: `}` token followed by template had been lost (fixes #293) (#294) (Toru Nagashima)
* 9810bab Fix: parsing error on `async` as property name. (#295) (Toru Nagashima)
v3.3.0 - September 20, 2016
* 92b04b1 Update: create-test script (fixes #291) (#292) (Jamund Ferguson)
v3.2.0 - September 16, 2016
* 5a37f80 Build: Update release tool (Nicholas C. Zakas)
* 9bbcad8 Update: Upgrade Acorn to support ES2017 (fixes #287) (#290) (Jamund Ferguson)
* 8d9767d Build: Add CI release scripts (Nicholas C. Zakas)
v3.1.7 - July 29, 2016
* 8f6cfbd Build: Add CI release (Nicholas C. Zakas)
* ff15922 Fix: Catch ES2016 invalid syntax (fixes #284) (#285) (Nicholas C. Zakas)
v3.1.6 - June 15, 2016
* a90edc2 Upgrade: acorn 3.2.0 (fixes #279) (#280) (Toru Nagashima)
v3.1.5 - May 27, 2016
* 7df2e4a Fix: Convert ~ and ! prefix tokens to esprima (fixes #274) (#276) (Daniel Tschinder)
v3.1.4 - April 21, 2016
* e044705 Fix: remove extra leading comments at node level (fixes #264) (Kai Cataldo)
* 25c27fb Chore: Remove jQuery copyright from header of each file (Kai Cataldo)
* 10709f0 Chore: Add jQuery Foundation copyright (Nicholas C. Zakas)
* d754b32 Upgrade: Acorn 3.1.0 (fixes #270) (Toru Nagashima)
* 3a90886 Docs: replace a dead link with the correct contributing guide URL (Shinnosuke Watanabe)
* 55184a2 Build: replace optimist with a simple native method (Shinnosuke Watanabe)
* c7e5a13 Fix: Disallow namespaces objects in JSX (fixes #261) (Kai Cataldo)
* 22290b9 Fix: Add test for leading comments (fixes #136) (Kai Cataldo)
v3.1.3 - March 18, 2016
* 98441cb Fix: Fix behavior of ignoring comments within previous nodes (refs #256) (Kai Cataldo)
v3.1.2 - March 14, 2016
* a2b23ca Fix: Ensure 'var let' works (fixes #149) (Nicholas C. Zakas)
* 5783282 Fix: Make obj.await work in modules (fixes #258) (Nicholas C. Zakas)
* d1b4929 Fix: leading comments added from previous node (fixes #256) (Kai Cataldo)
v3.1.1 - February 26, 2016
* 3614e81 Fix: exponentiation operator token (fixes #254) (Nicholas C. Zakas)
v3.1.0 - February 25, 2016
* da35d98 New: Support ecmaVersion 7 (fixes #246) (Nicholas C. Zakas)
v3.0.2 - February 19, 2016
* 0973cda Build: Update release script (Nicholas C. Zakas)
* 106000f Fix: use the plugins feature of acorn (fixes #250) (Toru Nagashima)
* 36d84c7 Build: Add tests (fixes #243) (Nicholas C. Zakas)
v3.0.1 - February 2, 2016
* ecfe4c8 Upgrade: eslint-config-eslint to 3.0.0 (Nicholas C. Zakas)
* ea6261e Fix: Object rest/spread in assign (fixes #247) (Nicholas C. Zakas)
* 7e57ee0 Docs: fix `options.comment` typo (xuezu)
* dd5863e Build: Add prerelease script (Nicholas C. Zakas)
* 0b409ee Upgrade: eslint-release to 0.2.0 (Nicholas C. Zakas)
v3.0.0 - January 20, 2016
* 5ff65f6 Upgrade: Change Esprima version to latest (Nicholas C. Zakas)
* a8badcc Upgrade: eslint-release to 0.1.4 (Nicholas C. Zakas)
* 34d195b Build: Switch to eslint-release (Nicholas C. Zakas)
* a0ddc30 Breaking: Remove binary scripts (Nicholas C. Zakas)
* 02b5284 Build: Fix package.json dependencies (Nicholas C. Zakas)
* b07696f Fix: tests for importing keywords (fixes #225) (Toru Nagashima)
* 2e2808a Build: Add node@5 to CI (fixes #237) (alberto)
* 445c685 Update: Unrecognized license format in package.json (fixes #234) (alberto)
* 61cb5ee Update: Remove duplicated acorn-jsx dep (fixes #232) (alberto)
* df5b71c Upgrade: eslint and eslint-config-eslint (fixes #231) (alberto)
* ef7a06d Fix: lastToken not reset between calls to parse (fixes #229) (alberto)
* cdf8407 New: ecmaFeatures.impliedStrict (fixes: #227) (Nick Evans)
v3.0.0-alpha-2 - December 9, 2015
* 3.0.0-alpha-2 (Nicholas C. Zakas)
* Breaking: move ecmaFeatures into ecmaVersion (fixes #222) (Nicholas C. Zakas)
* New: Export VisitorKeys (fixes #220) (Nicholas C. Zakas)
v3.0.0-alpha-1 - December 1, 2015
* 3.0.0-alpha-1 (Nicholas C. Zakas)
* Fix: parse unicode escapes in identifiers (fixes #181) (Nicholas C. Zakas)
* Fix: Ensur object rest works in destructed arg (fixes #213) (Nicholas C. Zakas)
* Breaking: Switch to Acorn (fixes #200) (Nicholas C. Zakas)
* Update: Add tokens to tests (fixes #203) (Nicholas C. Zakas)
* Docs: Update README (Nicholas C. Zakas)
v2.2.5 - September 15, 2015
* 2.2.5 (Nicholas C. Zakas)
* Fix: Ensure node type is correct for destructured (fixes #195) (Nicholas C. Zakas)
v2.2.4 - August 13, 2015
* 2.2.4 (Nicholas C. Zakas)
* Fix: newlines in arrow functions (fixes #172) (Jamund Ferguson)
* Fix: nested arrow function as default param (fixes #145) (Jamund Ferguson)
* Fix: Rest Params & Arrow Functions (fixes #187) (Jamund Ferguson)
* Fix: trailing commas in import/export (fixes #148) (Jamund Ferguson)
* Build: Added sudo false to Travis to build faster (fixes #177) (KahWee Teng)
v2.2.3 - July 22, 2015
* 2.2.3 (Nicholas C. Zakas)
* Fix: Incorrect error location (fixes #173) (Nicholas C. Zakas)
v2.2.2 - July 16, 2015
* 2.2.2 (Nicholas C. Zakas)
* 2.2.1 (Nicholas C. Zakas)
* Fix: Yield as identifier in arrow func args (fixes #165) (Nicholas C. Zakas)
* Fix: Allow AssignmentExpression in object spread (fixes #167) (Nicholas C. Zakas)
v2.2.1 - July 16, 2015
* 2.2.1 (Nicholas C. Zakas)
v2.2.0 - July 15, 2015
* 2.2.0 (Nicholas C. Zakas)
* New: Add experimental object rest/spread (fixes #163) (Nicholas C. Zakas)
* Fix: npm browserify (fixes #156) (Jason Laster)
v2.1.0 - July 10, 2015
* 2.1.0 (Nicholas C. Zakas)
* Fix: Leading comments for anonymous classes (fixes #155, fixes #158) (Toru Nagashima)
* New: Add newTarget option (fixes #157) (Nicholas C. Zakas)
v2.0.4 - June 26, 2015
* 2.0.4 (Nicholas C. Zakas)
* Docs: added missing `ecmaFeatures.superInFunctions` option from doc (Clément Fiorio)
* Fix: "await" is a future reserved word (fixes #151) (Jose Roberto Vidal)
v2.0.3 - June 2, 2015
* 2.0.3 (Nicholas C. Zakas)
* Fix: Incomplete Switch Statement Hangs (Fixes #146) (Jamund Ferguson)
* Docs: Clarify ecmaFeatures usage (Dan Wolff)
v2.0.2 - April 28, 2015
* 2.0.2 (Nicholas C. Zakas)
* Fix: Allow yield without value as function param (fixes #134) (Nicholas C. Zakas)
* Fix: Allow computed generators in classes (fixes #123) (Nicholas C. Zakas)
* Fix: Don't allow arrow function rest param (fixes #130) (Nicholas C. Zakas)
v2.0.1 - April 11, 2015
* 2.0.1 (Nicholas C. Zakas)
* Fix: Yield should parse without an argument (fixes #121) (Nicholas C. Zakas)
v2.0.0 - April 4, 2015
* 2.0.0 (Nicholas C. Zakas)
* Docs: Update README with latest info (Nicholas C. Zakas)
* Breaking: Use ESTree format for default params (fixes #114) (Nicholas C. Zakas)
* New: Add Super node (fixes #115) (Nicholas C. Zakas)
* Breaking: Switch to RestElement for rest args (fixes #84) (Nicholas C. Zakas)
* Docs: Correct license info on README (fixes #117) (AJ Ortega)
* Breaking: Remove guardedHandlers/handlers from try (fixes #71) (Nicholas C. Zakas)
v1.12.3 - March 28, 2015
* 1.12.3 (Nicholas C. Zakas)
* Fix: Tagged template strings (fixes #110) (Nicholas C. Zakas)
v1.12.2 - March 21, 2015
* 1.12.2 (Nicholas C. Zakas)
* Fix: Destructured arg for catch (fixes #105) (Nicholas C. Zakas)
v1.12.1 - March 21, 2015
* 1.12.1 (Nicholas C. Zakas)
* Fix: Disallow octals in template strings (fixes #96) (Nicholas C. Zakas)
* Fix: Template string parsing (fixes #95) (Nicholas C. Zakas)
* Fix: shorthand properties named get or set (fixes #100) (Brandon Mills)
* Fix: bad error in parsing invalid class setter (fixes #98) (Marsup)
v1.12.0 - March 14, 2015
* 1.12.0 (Nicholas C. Zakas)
* Fix: Update broken tests (Nicholas C. Zakas)
* New: Add sourceType to Program node (fixes #93) (Nicholas C. Zakas)
* Allow spread in more places (fixes #89) (Nicholas C. Zakas)
* Fix: Deeply nested template literals (fixes #86) (Nicholas C. Zakas)
* Fix: Allow super in classes by default (fixes #87) (Nicholas C. Zakas)
* Fix: generator methods in classes (fixes #85) (Jamund Ferguson)
* Remove XJS note from Esprima-FB incompatibilities (Joe Lencioni)
v1.11.0 - March 7, 2015
* 1.11.0 (Nicholas C. Zakas)
* Fix: Don't allow default export class by mistake (fixes #82) (Nicholas C. Zakas)
* Fix: Export default function should be FunctionDeclaration (fixes #81) (Nicholas C. Zakas)
* Fix: Ensure class declarations must have IDs outside of exports (refs #72) (Nicholas C. Zakas)
* Fix: export class expression support (refs #72) (Jamund Ferguson)
* Update: Add tests for sourceType=module (refs #72) (Nicholas C. Zakas)
* Fix: Class name should be id (fixes #78) (Nicholas C. Zakas)
* Fix: disallow import/export in functions (refs #72) (Jamund Ferguson)
* Test: strict mode enforced in modules (refs #72) (Jamund Ferguson)
* New: Add modules feature flag (refs #72) (Nicholas C. Zakas)
* merging upstream and solving conflicts for PR #43 (Caridy Patino)
* New: Add ES6 module support (fixes #35) (Caridy Patino)
* Update: Add TryStatement.handler (fixes #69) (Brandon Mills)
* Fix: Destructured Defaults (fixes #56) (Jamund Ferguson)
* Update: Refactor out comment attachment logic (Nicholas C. Zakas)
v1.10.0 - March 1, 2015
* 1.10.0 (Nicholas C. Zakas)
* New: Support ES6 classes (refs #10) (Nicholas C. Zakas)
* Docs: Update README.md (Jamund Ferguson)
v1.9.1 - February 21, 2015
* 1.9.1 (Nicholas C. Zakas)
* Fix: Allow let/const in switchcase (fixes #54) (Nicholas C. Zakas)
v1.9.0 - February 21, 2015
* 1.9.0 (Nicholas C. Zakas)
* Fix: Extend property method range and loc to include params (fixes #36) (Brandon Mills)
* New: spread operator (refs #10) (Jamund Ferguson)
* Fix: incorrectly parsed arrow fragment (refs #58) (Jamund Ferguson)
* New: Rest Parameter (refs: #10) (Jamund Ferguson)
* New: Destructuring (refs #10) (Jamund Ferguson)
v1.8.1 - February 7, 2015
* 1.8.1 (Nicholas C. Zakas)
* Build: Add Node.js 0.12 testing (Nicholas C. Zakas)
* Fix: Actuall fix tokenization issue with templates (fixes #44) (Nicholas C. Zakas)
v1.8.0 - February 6, 2015
* 1.8.0 (Nicholas C. Zakas)
* New: Support for Arrow Functions (refs #10) (Jamund Ferguson)
* New: Allow super references in functions (refs #10) (Nicholas C. Zakas)
* Update create-test.js (Jamund Ferguson)
* Fix: Tokenization for template strings (fixes #44) (Nicholas C. Zakas)
* New: Allow return in global scope (fixes #46) (Nicholas C. Zakas)
v1.7.1 - January 23, 2015
* 1.7.1 (Nicholas C. Zakas)
* Fix: When ecmaFeatures.forOf is true, check for operater is "undefined" when match keyword is "in" (fixes #39) (Peter Chanthamynavong)
v1.7.0 - January 23, 2015
* 1.7.0 (Nicholas C. Zakas)
* New: Add support for template strings (FredKSchott)
* New: Add support for default parameters (refs #10) (Jamund Ferguson)
* New: Add support for unicode code point escape sequences (FredKSchott)
v1.6.0 - January 10, 2015
* 1.6.0 (Nicholas C. Zakas)
* Update: Make comment attachment tests look at whole AST (Nicholas C. Zakas)
* Docs: Update README to reflect feature flags (Nicholas C. Zakas)
* Docs: Add a couple more FAQs to README (Nicholas C. Zakas)
* New: Add support for duplicate object literal properties (FredKSchott)
* New: Implement generators (refs #10) (Nicholas C. Zakas)
v1.5.0 - December 29, 2014
* 1.5.0 (Nicholas C. Zakas)
* Docs: Update README with compat info (Nicholas C. Zakas)
* Update: Add regex parsing test (Nicholas C. Zakas)
* Update: s/XJS/JSX/g (Nicholas C. Zakas)
* Build: Update release script (Nicholas C. Zakas)
* Update: Move SyntaxTree to ast-node-factory.js (FredKSchott)
* New: Add JSX parsing (fixes #26) (Nicholas C. Zakas)
* Update: Switch location marker logic (fixes #15) (Nicholas C. Zakas)
* 1.4.0 (Nicholas C. Zakas)
v1.4.0 - December 23, 2014
* 1.4.0 (Nicholas C. Zakas)
* Fix: Parsing issues with property methods (fixes #21) (Nicholas C. Zakas)
* New: Add support for shorthand properties (refs #10) (Nicholas C. Zakas)
* New: Add support for object literal method shorthand (refs #10) (Nicholas C. Zakas)
* Fix: Ensure comments are attached for return (fixes #2) (Nicholas C. Zakas)
* Build: Ensure CHANGELOG.md is committed on release (Nicholas C. Zakas)
* 1.3.1 (Nicholas C. Zakas)
v1.3.1 - December 22, 2014
* 1.3.1 (Nicholas C. Zakas)
* Fix: Add all files to npm package (fixes #17) (Nicholas C. Zakas)
* Update: Move Messages to separate file (Nicholas C. Zakas)
* Docs: Removed unnecessary comment (Nicholas C. Zakas)
* 1.3.0 (Nicholas C. Zakas)
v1.3.0 - December 21, 2014
* 1.3.0 (Nicholas C. Zakas)
* Build: Add release scripts (Nicholas C. Zakas)
* New: Add computed object literal properties (refs #10) (Nicholas C. Zakas)
* Build: Fix commands in Makefile.js (Nicholas C. Zakas)
* Docs: Add FAQ to README (Nicholas C. Zakas)
* Fix: Don't allow let/const in for loops (fixes #14) (Nicholas C. Zakas)
* New: Support for-of loops (refs #10) (Nicholas C. Zakas)
* Update: Change .ast.js files to .result.js files (Nicholas C. Zakas)
* New: Support ES6 octal literals (Nicholas C. Zakas)
* New: Ability to parse binary literals (Nicholas C. Zakas)
* Update: More tests for regex u flag (Nicholas C. Zakas)
* Update: Switch to using ecmaFeatures (Nicholas C. Zakas)
* Update: Add comment attachment tests (Nicholas C. Zakas)
* Update README.md (Jamund Ferguson)
* New: Add u and y regex flags (refs #10) (Nicholas C. Zakas)
* Update: Cleanup tests (Nicholas C. Zakas)
* New: Add ecmascript flag (fixes #7) (Nicholas C. Zakas)
* Docs: Update README with build commands (Nicholas C. Zakas)
* Update: Move some things around (Nicholas C. Zakas)
* Update: Read version number from package.json (Nicholas C. Zakas)
* Update: Move AST node types to separate file (Nicholas C. Zakas)
* Update: Remove duplicate file (Nicholas C. Zakas)
* Update: Move token information to a separate file (Nicholas C. Zakas)
* Update: Bring in Makefile.js for linting and browserify (Nicholas C. Zakas)
* Update: Fix ESLint warnings, remove check-version (Nicholas C. Zakas)
* Update: Move Position and SourceLocation to separate file (Nicholas C. Zakas)
* Update: Move syntax checks into separate file (Nicholas C. Zakas)
* Update: Remove UMD format (Nicholas C. Zakas)
* Docs: Update README with more info (Nicholas C. Zakas)
* Update: remove npm-debug.log from tracked files (Brandon Mills)
* Docs: Remove redundant 'features' in readme (Matthias Oßwald)
* Docs: Fix a link to Wikipedia (Ryuichi Okumura)
* Update: Split parsing tests into smaller files (Nicholas C. Zakas)
* Update: Normalize values in tests (Nicholas C. Zakas)
* Update: CommonJSify test file (Nicholas C. Zakas)

49
node_modules/espree/README.md generated vendored
View file

@ -1,6 +1,6 @@
[![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree)
[![Build Status](https://travis-ci.org/eslint/espree.svg?branch=master)](https://travis-ci.org/eslint/espree)
[![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree)
[![Build Status](https://github.com/eslint/espree/workflows/CI/badge.svg)](https://github.com/eslint/espree/actions)
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE)
# Espree
@ -15,9 +15,17 @@ Install:
npm i espree
```
And in your Node.js code:
To use in an ESM file:
```javascript
```js
import * as espree from "espree";
const ast = espree.parse(code);
```
To use in a Common JS file:
```js
const espree = require("espree");
const ast = espree.parse(code);
@ -29,13 +37,13 @@ const ast = espree.parse(code);
`parse` parses the given code and returns a abstract syntax tree (AST). It takes two parameters.
- `code` [string]() - the code which needs to be parsed.
- `code` [string]() - the code which needs to be parsed.
- `options (Optional)` [Object]() - read more about this [here](#options).
```javascript
const espree = require("espree");
```js
import * as espree from "espree";
const ast = espree.parse(code, options);
const ast = espree.parse(code);
```
**Example :**
@ -73,7 +81,7 @@ Node {
`tokenize` returns the tokens of a given code. It takes two parameters.
- `code` [string]() - the code which needs to be parsed.
- `code` [string]() - the code which needs to be parsed.
- `options (Optional)` [Object]() - read more about this [here](#options).
Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array
@ -81,6 +89,8 @@ Even if `options` is empty or undefined or `options.tokens` is `false`, it assig
**Example :**
```js
import * as espree from "espree";
const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 });
console.log(tokens);
```
@ -114,7 +124,7 @@ Returns the latest ECMAScript supported by `espree`
Returns an array of all supported ECMAScript versions
## Options
## Options
```js
const options = {
@ -130,11 +140,14 @@ const options = {
// create a top-level tokens array containing all tokens
tokens: false,
// Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use.
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming.
ecmaVersion: 5,
// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13 or 14 to specify the version of ECMAScript syntax you want to use.
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13) or 2023 (same as 14) to use the year-based naming.
// You can also set "latest" to use the most recently supported version.
ecmaVersion: 3,
// specify which type of script you're parsing ("script" or "module")
allowReserved: true, // only allowed when ecmaVersion is 3
// specify which type of script you're parsing ("script", "module", or "commonjs")
sourceType: "script",
// specify additional language features
@ -143,7 +156,7 @@ const options = {
// enable JSX parsing
jsx: false,
// enable return in global scope
// enable return in global scope (set to true automatically when sourceType is "commonjs")
globalReturn: false,
// enable implied strict mode (if ecmaVersion >= 5)
@ -172,7 +185,6 @@ We work hard to ensure that Espree is safe for everyone and that security issues
* `npm test` - run all linting and tests
* `npm run lint` - run all linting
* `npm run browserify` - creates a version of Espree that is usable in a browser
## Differences from Espree 2.x
@ -219,12 +231,11 @@ We are building on top of Acorn, however, so that we can contribute back and hel
### What ECMAScript features do you support?
Espree supports all ECMAScript 2020 features and partially supports ECMAScript 2021 features.
Espree supports all ECMAScript 2022 features and partially supports ECMAScript 2023 features.
Because ECMAScript 2021 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
Because ECMAScript 2023 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
* [Logical Assignment Operators](https://github.com/tc39/proposal-logical-assignment)
* [Numeric Separators](https://github.com/tc39/proposal-numeric-separator)
* [Hashbang grammar](https://github.com/tc39/proposal-hashbang)
See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.

938
node_modules/espree/dist/espree.cjs generated vendored Normal file
View file

@ -0,0 +1,938 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var acorn = require('acorn');
var jsx = require('acorn-jsx');
var visitorKeys = require('eslint-visitor-keys');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn);
var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys);
/**
* @fileoverview Translates tokens between Acorn format and Esprima format.
* @author Nicholas C. Zakas
*/
/* eslint no-underscore-dangle: 0 */
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
// none!
//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------
// Esprima Token Types
const Token = {
Boolean: "Boolean",
EOF: "<end>",
Identifier: "Identifier",
PrivateIdentifier: "PrivateIdentifier",
Keyword: "Keyword",
Null: "Null",
Numeric: "Numeric",
Punctuator: "Punctuator",
String: "String",
RegularExpression: "RegularExpression",
Template: "Template",
JSXIdentifier: "JSXIdentifier",
JSXText: "JSXText"
};
/**
* Converts part of a template into an Esprima token.
* @param {AcornToken[]} tokens The Acorn tokens representing the template.
* @param {string} code The source code.
* @returns {EsprimaToken} The Esprima equivalent of the template token.
* @private
*/
function convertTemplatePart(tokens, code) {
const firstToken = tokens[0],
lastTemplateToken = tokens[tokens.length - 1];
const token = {
type: Token.Template,
value: code.slice(firstToken.start, lastTemplateToken.end)
};
if (firstToken.loc) {
token.loc = {
start: firstToken.loc.start,
end: lastTemplateToken.loc.end
};
}
if (firstToken.range) {
token.start = firstToken.range[0];
token.end = lastTemplateToken.range[1];
token.range = [token.start, token.end];
}
return token;
}
/**
* Contains logic to translate Acorn tokens into Esprima tokens.
* @param {Object} acornTokTypes The Acorn token types.
* @param {string} code The source code Acorn is parsing. This is necessary
* to correct the "value" property of some tokens.
* @constructor
*/
function TokenTranslator(acornTokTypes, code) {
// token types
this._acornTokTypes = acornTokTypes;
// token buffer for templates
this._tokens = [];
// track the last curly brace
this._curlyBrace = null;
// the source code
this._code = code;
}
TokenTranslator.prototype = {
constructor: TokenTranslator,
/**
* Translates a single Esprima token to a single Acorn token. This may be
* inaccurate due to how templates are handled differently in Esprima and
* Acorn, but should be accurate for all other tokens.
* @param {AcornToken} token The Acorn token to translate.
* @param {Object} extra Espree extra object.
* @returns {EsprimaToken} The Esprima version of the token.
*/
translate(token, extra) {
const type = token.type,
tt = this._acornTokTypes;
if (type === tt.name) {
token.type = Token.Identifier;
// TODO: See if this is an Acorn bug
if (token.value === "static") {
token.type = Token.Keyword;
}
if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) {
token.type = Token.Keyword;
}
} else if (type === tt.privateId) {
token.type = Token.PrivateIdentifier;
} else if (type === tt.semi || type === tt.comma ||
type === tt.parenL || type === tt.parenR ||
type === tt.braceL || type === tt.braceR ||
type === tt.dot || type === tt.bracketL ||
type === tt.colon || type === tt.question ||
type === tt.bracketR || type === tt.ellipsis ||
type === tt.arrow || type === tt.jsxTagStart ||
type === tt.incDec || type === tt.starstar ||
type === tt.jsxTagEnd || type === tt.prefix ||
type === tt.questionDot ||
(type.binop && !type.keyword) ||
type.isAssign) {
token.type = Token.Punctuator;
token.value = this._code.slice(token.start, token.end);
} else if (type === tt.jsxName) {
token.type = Token.JSXIdentifier;
} else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) {
token.type = Token.JSXText;
} else if (type.keyword) {
if (type.keyword === "true" || type.keyword === "false") {
token.type = Token.Boolean;
} else if (type.keyword === "null") {
token.type = Token.Null;
} else {
token.type = Token.Keyword;
}
} else if (type === tt.num) {
token.type = Token.Numeric;
token.value = this._code.slice(token.start, token.end);
} else if (type === tt.string) {
if (extra.jsxAttrValueToken) {
extra.jsxAttrValueToken = false;
token.type = Token.JSXText;
} else {
token.type = Token.String;
}
token.value = this._code.slice(token.start, token.end);
} else if (type === tt.regexp) {
token.type = Token.RegularExpression;
const value = token.value;
token.regex = {
flags: value.flags,
pattern: value.pattern
};
token.value = `/${value.pattern}/${value.flags}`;
}
return token;
},
/**
* Function to call during Acorn's onToken handler.
* @param {AcornToken} token The Acorn token.
* @param {Object} extra The Espree extra object.
* @returns {void}
*/
onToken(token, extra) {
const that = this,
tt = this._acornTokTypes,
tokens = extra.tokens,
templateTokens = this._tokens;
/**
* Flushes the buffered template tokens and resets the template
* tracking.
* @returns {void}
* @private
*/
function translateTemplateTokens() {
tokens.push(convertTemplatePart(that._tokens, that._code));
that._tokens = [];
}
if (token.type === tt.eof) {
// might be one last curlyBrace
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
}
return;
}
if (token.type === tt.backQuote) {
// if there's already a curly, it's not part of the template
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
this._curlyBrace = null;
}
templateTokens.push(token);
// it's the end
if (templateTokens.length > 1) {
translateTemplateTokens();
}
return;
}
if (token.type === tt.dollarBraceL) {
templateTokens.push(token);
translateTemplateTokens();
return;
}
if (token.type === tt.braceR) {
// if there's already a curly, it's not part of the template
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
}
// store new curly for later
this._curlyBrace = token;
return;
}
if (token.type === tt.template || token.type === tt.invalidTemplate) {
if (this._curlyBrace) {
templateTokens.push(this._curlyBrace);
this._curlyBrace = null;
}
templateTokens.push(token);
return;
}
if (this._curlyBrace) {
tokens.push(this.translate(this._curlyBrace, extra));
this._curlyBrace = null;
}
tokens.push(this.translate(token, extra));
}
};
/**
* @fileoverview A collection of methods for processing Espree's options.
* @author Kai Cataldo
*/
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const SUPPORTED_VERSIONS = [
3,
5,
6, // 2015
7, // 2016
8, // 2017
9, // 2018
10, // 2019
11, // 2020
12, // 2021
13, // 2022
14 // 2023
];
/**
* Get the latest ECMAScript version supported by Espree.
* @returns {number} The latest ECMAScript version.
*/
function getLatestEcmaVersion() {
return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1];
}
/**
* Get the list of ECMAScript versions supported by Espree.
* @returns {number[]} An array containing the supported ECMAScript versions.
*/
function getSupportedEcmaVersions() {
return [...SUPPORTED_VERSIONS];
}
/**
* Normalize ECMAScript version from the initial config
* @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config
* @throws {Error} throws an error if the ecmaVersion is invalid.
* @returns {number} normalized ECMAScript version
*/
function normalizeEcmaVersion(ecmaVersion = 5) {
let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;
if (typeof version !== "number") {
throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`);
}
// Calculate ECMAScript edition number from official year version starting with
// ES2015, which corresponds with ES6 (or a difference of 2009).
if (version >= 2015) {
version -= 2009;
}
if (!SUPPORTED_VERSIONS.includes(version)) {
throw new Error("Invalid ecmaVersion.");
}
return version;
}
/**
* Normalize sourceType from the initial config
* @param {string} sourceType to normalize
* @throws {Error} throw an error if sourceType is invalid
* @returns {string} normalized sourceType
*/
function normalizeSourceType(sourceType = "script") {
if (sourceType === "script" || sourceType === "module") {
return sourceType;
}
if (sourceType === "commonjs") {
return "script";
}
throw new Error("Invalid sourceType.");
}
/**
* Normalize parserOptions
* @param {Object} options the parser options to normalize
* @throws {Error} throw an error if found invalid option.
* @returns {Object} normalized options
*/
function normalizeOptions(options) {
const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
const sourceType = normalizeSourceType(options.sourceType);
const ranges = options.range === true;
const locations = options.loc === true;
if (ecmaVersion !== 3 && options.allowReserved) {
// a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
throw new Error("`allowReserved` is only supported when ecmaVersion is 3");
}
if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") {
throw new Error("`allowReserved`, when present, must be `true` or `false`");
}
const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false;
const ecmaFeatures = options.ecmaFeatures || {};
const allowReturnOutsideFunction = options.sourceType === "commonjs" ||
Boolean(ecmaFeatures.globalReturn);
if (sourceType === "module" && ecmaVersion < 6) {
throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");
}
return Object.assign({}, options, {
ecmaVersion,
sourceType,
ranges,
locations,
allowReserved,
allowReturnOutsideFunction
});
}
/* eslint-disable no-param-reassign*/
const STATE = Symbol("espree's internal state");
const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");
/**
* Converts an Acorn comment to a Esprima comment.
* @param {boolean} block True if it's a block comment, false if not.
* @param {string} text The text of the comment.
* @param {int} start The index at which the comment starts.
* @param {int} end The index at which the comment ends.
* @param {Location} startLoc The location at which the comment starts.
* @param {Location} endLoc The location at which the comment ends.
* @param {string} code The source code being parsed.
* @returns {Object} The comment object.
* @private
*/
function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) {
let type;
if (block) {
type = "Block";
} else if (code.slice(start, start + 2) === "#!") {
type = "Hashbang";
} else {
type = "Line";
}
const comment = {
type,
value: text
};
if (typeof start === "number") {
comment.start = start;
comment.end = end;
comment.range = [start, end];
}
if (typeof startLoc === "object") {
comment.loc = {
start: startLoc,
end: endLoc
};
}
return comment;
}
var espree = () => Parser => {
const tokTypes = Object.assign({}, Parser.acorn.tokTypes);
if (Parser.acornJsx) {
Object.assign(tokTypes, Parser.acornJsx.tokTypes);
}
return class Espree extends Parser {
constructor(opts, code) {
if (typeof opts !== "object" || opts === null) {
opts = {};
}
if (typeof code !== "string" && !(code instanceof String)) {
code = String(code);
}
// save original source type in case of commonjs
const originalSourceType = opts.sourceType;
const options = normalizeOptions(opts);
const ecmaFeatures = options.ecmaFeatures || {};
const tokenTranslator =
options.tokens === true
? new TokenTranslator(tokTypes, code)
: null;
/*
* Data that is unique to Espree and is not represented internally
* in Acorn.
*
* For ES2023 hashbangs, Espree will call `onComment()` during the
* constructor, so we must define state before having access to
* `this`.
*/
const state = {
originalSourceType: originalSourceType || options.sourceType,
tokens: tokenTranslator ? [] : null,
comments: options.comment === true ? [] : null,
impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5,
ecmaVersion: options.ecmaVersion,
jsxAttrValueToken: false,
lastToken: null,
templateElements: []
};
// Initialize acorn parser.
super({
// do not use spread, because we don't want to pass any unknown options to acorn
ecmaVersion: options.ecmaVersion,
sourceType: options.sourceType,
ranges: options.ranges,
locations: options.locations,
allowReserved: options.allowReserved,
// Truthy value is true for backward compatibility.
allowReturnOutsideFunction: options.allowReturnOutsideFunction,
// Collect tokens
onToken: token => {
if (tokenTranslator) {
// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
tokenTranslator.onToken(token, state);
}
if (token.type !== tokTypes.eof) {
state.lastToken = token;
}
},
// Collect comments
onComment: (block, text, start, end, startLoc, endLoc) => {
if (state.comments) {
const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code);
state.comments.push(comment);
}
}
}, code);
/*
* We put all of this data into a symbol property as a way to avoid
* potential naming conflicts with future versions of Acorn.
*/
this[STATE] = state;
}
tokenize() {
do {
this.next();
} while (this.type !== tokTypes.eof);
// Consume the final eof token
this.next();
const extra = this[STATE];
const tokens = extra.tokens;
if (extra.comments) {
tokens.comments = extra.comments;
}
return tokens;
}
finishNode(...args) {
const result = super.finishNode(...args);
return this[ESPRIMA_FINISH_NODE](result);
}
finishNodeAt(...args) {
const result = super.finishNodeAt(...args);
return this[ESPRIMA_FINISH_NODE](result);
}
parse() {
const extra = this[STATE];
const program = super.parse();
program.sourceType = extra.originalSourceType;
if (extra.comments) {
program.comments = extra.comments;
}
if (extra.tokens) {
program.tokens = extra.tokens;
}
/*
* Adjust opening and closing position of program to match Esprima.
* Acorn always starts programs at range 0 whereas Esprima starts at the
* first AST node's start (the only real difference is when there's leading
* whitespace or leading comments). Acorn also counts trailing whitespace
* as part of the program whereas Esprima only counts up to the last token.
*/
if (program.body.length) {
const [firstNode] = program.body;
if (program.range) {
program.range[0] = firstNode.range[0];
}
if (program.loc) {
program.loc.start = firstNode.loc.start;
}
program.start = firstNode.start;
}
if (extra.lastToken) {
if (program.range) {
program.range[1] = extra.lastToken.range[1];
}
if (program.loc) {
program.loc.end = extra.lastToken.loc.end;
}
program.end = extra.lastToken.end;
}
/*
* https://github.com/eslint/espree/issues/349
* Ensure that template elements have correct range information.
* This is one location where Acorn produces a different value
* for its start and end properties vs. the values present in the
* range property. In order to avoid confusion, we set the start
* and end properties to the values that are present in range.
* This is done here, instead of in finishNode(), because Acorn
* uses the values of start and end internally while parsing, making
* it dangerous to change those values while parsing is ongoing.
* By waiting until the end of parsing, we can safely change these
* values without affect any other part of the process.
*/
this[STATE].templateElements.forEach(templateElement => {
const startOffset = -1;
const endOffset = templateElement.tail ? 1 : 2;
templateElement.start += startOffset;
templateElement.end += endOffset;
if (templateElement.range) {
templateElement.range[0] += startOffset;
templateElement.range[1] += endOffset;
}
if (templateElement.loc) {
templateElement.loc.start.column += startOffset;
templateElement.loc.end.column += endOffset;
}
});
return program;
}
parseTopLevel(node) {
if (this[STATE].impliedStrict) {
this.strict = true;
}
return super.parseTopLevel(node);
}
/**
* Overwrites the default raise method to throw Esprima-style errors.
* @param {int} pos The position of the error.
* @param {string} message The error message.
* @throws {SyntaxError} A syntax error.
* @returns {void}
*/
raise(pos, message) {
const loc = Parser.acorn.getLineInfo(this.input, pos);
const err = new SyntaxError(message);
err.index = pos;
err.lineNumber = loc.line;
err.column = loc.column + 1; // acorn uses 0-based columns
throw err;
}
/**
* Overwrites the default raise method to throw Esprima-style errors.
* @param {int} pos The position of the error.
* @param {string} message The error message.
* @throws {SyntaxError} A syntax error.
* @returns {void}
*/
raiseRecoverable(pos, message) {
this.raise(pos, message);
}
/**
* Overwrites the default unexpected method to throw Esprima-style errors.
* @param {int} pos The position of the error.
* @throws {SyntaxError} A syntax error.
* @returns {void}
*/
unexpected(pos) {
let message = "Unexpected token";
if (pos !== null && pos !== void 0) {
this.pos = pos;
if (this.options.locations) {
while (this.pos < this.lineStart) {
this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1;
--this.curLine;
}
}
this.nextToken();
}
if (this.end > this.start) {
message += ` ${this.input.slice(this.start, this.end)}`;
}
this.raise(this.start, message);
}
/*
* Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX
* uses regular tt.string without any distinction between this and regular JS
* strings. As such, we intercept an attempt to read a JSX string and set a flag
* on extra so that when tokens are converted, the next token will be switched
* to JSXText via onToken.
*/
jsx_readString(quote) { // eslint-disable-line camelcase
const result = super.jsx_readString(quote);
if (this.type === tokTypes.string) {
this[STATE].jsxAttrValueToken = true;
}
return result;
}
/**
* Performs last-minute Esprima-specific compatibility checks and fixes.
* @param {ASTNode} result The node to check.
* @returns {ASTNode} The finished node.
*/
[ESPRIMA_FINISH_NODE](result) {
// Acorn doesn't count the opening and closing backticks as part of templates
// so we have to adjust ranges/locations appropriately.
if (result.type === "TemplateElement") {
// save template element references to fix start/end later
this[STATE].templateElements.push(result);
}
if (result.type.includes("Function") && !result.generator) {
result.generator = false;
}
return result;
}
};
};
const version$1 = "9.4.1";
/**
* @fileoverview Main Espree file that converts Acorn into Esprima output.
*
* This file contains code from the following MIT-licensed projects:
* 1. Acorn
* 2. Babylon
* 3. Babel-ESLint
*
* This file also contains code from Esprima, which is BSD licensed.
*
* Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
* Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
* Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// To initialize lazily.
const parsers = {
_regular: null,
_jsx: null,
get regular() {
if (this._regular === null) {
this._regular = acorn__namespace.Parser.extend(espree());
}
return this._regular;
},
get jsx() {
if (this._jsx === null) {
this._jsx = acorn__namespace.Parser.extend(jsx__default["default"](), espree());
}
return this._jsx;
},
get(options) {
const useJsx = Boolean(
options &&
options.ecmaFeatures &&
options.ecmaFeatures.jsx
);
return useJsx ? this.jsx : this.regular;
}
};
//------------------------------------------------------------------------------
// Tokenizer
//------------------------------------------------------------------------------
/**
* Tokenizes the given code.
* @param {string} code The code to tokenize.
* @param {Object} options Options defining how to tokenize.
* @returns {Token[]} An array of tokens.
* @throws {SyntaxError} If the input code is invalid.
* @private
*/
function tokenize(code, options) {
const Parser = parsers.get(options);
// Ensure to collect tokens.
if (!options || options.tokens !== true) {
options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign
}
return new Parser(options, code).tokenize();
}
//------------------------------------------------------------------------------
// Parser
//------------------------------------------------------------------------------
/**
* Parses the given code.
* @param {string} code The code to tokenize.
* @param {Object} options Options defining how to tokenize.
* @returns {ASTNode} The "Program" AST node.
* @throws {SyntaxError} If the input code is invalid.
*/
function parse(code, options) {
const Parser = parsers.get(options);
return new Parser(options, code).parse();
}
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
const version = version$1;
/* istanbul ignore next */
const VisitorKeys = (function() {
return visitorKeys__namespace.KEYS;
}());
// Derive node types from VisitorKeys
/* istanbul ignore next */
const Syntax = (function() {
let name,
types = {};
if (typeof Object.create === "function") {
types = Object.create(null);
}
for (name in VisitorKeys) {
if (Object.hasOwnProperty.call(VisitorKeys, name)) {
types[name] = name;
}
}
if (typeof Object.freeze === "function") {
Object.freeze(types);
}
return types;
}());
const latestEcmaVersion = getLatestEcmaVersion();
const supportedEcmaVersions = getSupportedEcmaVersions();
exports.Syntax = Syntax;
exports.VisitorKeys = VisitorKeys;
exports.latestEcmaVersion = latestEcmaVersion;
exports.parse = parse;
exports.supportedEcmaVersions = supportedEcmaVersions;
exports.tokenize = tokenize;
exports.version = version;
//# sourceMappingURL=espree.cjs.map

46
node_modules/espree/espree.js generated vendored
View file

@ -56,13 +56,13 @@
*/
/* eslint no-undefined:0, no-use-before-define: 0 */
"use strict";
import * as acorn from "acorn";
import jsx from "acorn-jsx";
import espree from "./lib/espree.js";
import espreeVersion from "./lib/version.js";
import * as visitorKeys from "eslint-visitor-keys";
import { getLatestEcmaVersion, getSupportedEcmaVersions } from "./lib/options.js";
const acorn = require("acorn");
const jsx = require("acorn-jsx");
const astNodeTypes = require("./lib/ast-node-types");
const espree = require("./lib/espree");
const { getLatestEcmaVersion, getSupportedEcmaVersions } = require("./lib/options");
// To initialize lazily.
const parsers = {
@ -106,7 +106,7 @@ const parsers = {
* @throws {SyntaxError} If the input code is invalid.
* @private
*/
function tokenize(code, options) {
export function tokenize(code, options) {
const Parser = parsers.get(options);
// Ensure to collect tokens.
@ -128,7 +128,7 @@ function tokenize(code, options) {
* @returns {ASTNode} The "Program" AST node.
* @throws {SyntaxError} If the input code is invalid.
*/
function parse(code, options) {
export function parse(code, options) {
const Parser = parsers.get(options);
return new Parser(options, code).parse();
@ -138,15 +138,16 @@ function parse(code, options) {
// Public
//------------------------------------------------------------------------------
exports.version = require("./package.json").version;
export const version = espreeVersion;
exports.tokenize = tokenize;
exports.parse = parse;
// Deep copy.
/* istanbul ignore next */
exports.Syntax = (function() {
export const VisitorKeys = (function() {
return visitorKeys.KEYS;
}());
// Derive node types from VisitorKeys
/* istanbul ignore next */
export const Syntax = (function() {
let name,
types = {};
@ -154,9 +155,9 @@ exports.Syntax = (function() {
types = Object.create(null);
}
for (name in astNodeTypes) {
if (Object.hasOwnProperty.call(astNodeTypes, name)) {
types[name] = astNodeTypes[name];
for (name in VisitorKeys) {
if (Object.hasOwnProperty.call(VisitorKeys, name)) {
types[name] = name;
}
}
@ -167,11 +168,6 @@ exports.Syntax = (function() {
return types;
}());
/* istanbul ignore next */
exports.VisitorKeys = (function() {
return require("eslint-visitor-keys").KEYS;
}());
export const latestEcmaVersion = getLatestEcmaVersion();
exports.latestEcmaVersion = getLatestEcmaVersion();
exports.supportedEcmaVersions = getSupportedEcmaVersions();
export const supportedEcmaVersions = getSupportedEcmaVersions();

View file

@ -1,96 +0,0 @@
/**
* @fileoverview The AST node types produced by the parser.
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
// None!
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
module.exports = {
AssignmentExpression: "AssignmentExpression",
AssignmentPattern: "AssignmentPattern",
ArrayExpression: "ArrayExpression",
ArrayPattern: "ArrayPattern",
ArrowFunctionExpression: "ArrowFunctionExpression",
AwaitExpression: "AwaitExpression",
BlockStatement: "BlockStatement",
BinaryExpression: "BinaryExpression",
BreakStatement: "BreakStatement",
CallExpression: "CallExpression",
CatchClause: "CatchClause",
ClassBody: "ClassBody",
ClassDeclaration: "ClassDeclaration",
ClassExpression: "ClassExpression",
ConditionalExpression: "ConditionalExpression",
ContinueStatement: "ContinueStatement",
DoWhileStatement: "DoWhileStatement",
DebuggerStatement: "DebuggerStatement",
EmptyStatement: "EmptyStatement",
ExpressionStatement: "ExpressionStatement",
ForStatement: "ForStatement",
ForInStatement: "ForInStatement",
ForOfStatement: "ForOfStatement",
FunctionDeclaration: "FunctionDeclaration",
FunctionExpression: "FunctionExpression",
Identifier: "Identifier",
IfStatement: "IfStatement",
Literal: "Literal",
LabeledStatement: "LabeledStatement",
LogicalExpression: "LogicalExpression",
MemberExpression: "MemberExpression",
MetaProperty: "MetaProperty",
MethodDefinition: "MethodDefinition",
NewExpression: "NewExpression",
ObjectExpression: "ObjectExpression",
ObjectPattern: "ObjectPattern",
Program: "Program",
Property: "Property",
RestElement: "RestElement",
ReturnStatement: "ReturnStatement",
SequenceExpression: "SequenceExpression",
SpreadElement: "SpreadElement",
Super: "Super",
SwitchCase: "SwitchCase",
SwitchStatement: "SwitchStatement",
TaggedTemplateExpression: "TaggedTemplateExpression",
TemplateElement: "TemplateElement",
TemplateLiteral: "TemplateLiteral",
ThisExpression: "ThisExpression",
ThrowStatement: "ThrowStatement",
TryStatement: "TryStatement",
UnaryExpression: "UnaryExpression",
UpdateExpression: "UpdateExpression",
VariableDeclaration: "VariableDeclaration",
VariableDeclarator: "VariableDeclarator",
WhileStatement: "WhileStatement",
WithStatement: "WithStatement",
YieldExpression: "YieldExpression",
JSXIdentifier: "JSXIdentifier",
JSXNamespacedName: "JSXNamespacedName",
JSXMemberExpression: "JSXMemberExpression",
JSXEmptyExpression: "JSXEmptyExpression",
JSXExpressionContainer: "JSXExpressionContainer",
JSXElement: "JSXElement",
JSXClosingElement: "JSXClosingElement",
JSXOpeningElement: "JSXOpeningElement",
JSXAttribute: "JSXAttribute",
JSXSpreadAttribute: "JSXSpreadAttribute",
JSXText: "JSXText",
ExportDefaultDeclaration: "ExportDefaultDeclaration",
ExportNamedDeclaration: "ExportNamedDeclaration",
ExportAllDeclaration: "ExportAllDeclaration",
ExportSpecifier: "ExportSpecifier",
ImportDeclaration: "ImportDeclaration",
ImportSpecifier: "ImportSpecifier",
ImportDefaultSpecifier: "ImportDefaultSpecifier",
ImportNamespaceSpecifier: "ImportNamespaceSpecifier"
};

148
node_modules/espree/lib/espree.js generated vendored
View file

@ -1,8 +1,7 @@
"use strict";
/* eslint-disable no-param-reassign*/
const TokenTranslator = require("./token-translator");
const { normalizeOptions } = require("./options");
import TokenTranslator from "./token-translator.js";
import { normalizeOptions } from "./options.js";
const STATE = Symbol("espree's internal state");
const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");
@ -16,12 +15,23 @@ const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");
* @param {int} end The index at which the comment ends.
* @param {Location} startLoc The location at which the comment starts.
* @param {Location} endLoc The location at which the comment ends.
* @param {string} code The source code being parsed.
* @returns {Object} The comment object.
* @private
*/
function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) {
function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) {
let type;
if (block) {
type = "Block";
} else if (code.slice(start, start + 2) === "#!") {
type = "Hashbang";
} else {
type = "Line";
}
const comment = {
type: block ? "Block" : "Line",
type,
value: text
};
@ -41,7 +51,7 @@ function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc,
return comment;
}
module.exports = () => Parser => {
export default () => Parser => {
const tokTypes = Object.assign({}, Parser.acorn.tokTypes);
if (Parser.acornJsx) {
@ -57,6 +67,8 @@ module.exports = () => Parser => {
code = String(code);
}
// save original source type in case of commonjs
const originalSourceType = opts.sourceType;
const options = normalizeOptions(opts);
const ecmaFeatures = options.ecmaFeatures || {};
const tokenTranslator =
@ -64,49 +76,65 @@ module.exports = () => Parser => {
? new TokenTranslator(tokTypes, code)
: null;
/*
* Data that is unique to Espree and is not represented internally
* in Acorn.
*
* For ES2023 hashbangs, Espree will call `onComment()` during the
* constructor, so we must define state before having access to
* `this`.
*/
const state = {
originalSourceType: originalSourceType || options.sourceType,
tokens: tokenTranslator ? [] : null,
comments: options.comment === true ? [] : null,
impliedStrict: ecmaFeatures.impliedStrict === true && options.ecmaVersion >= 5,
ecmaVersion: options.ecmaVersion,
jsxAttrValueToken: false,
lastToken: null,
templateElements: []
};
// Initialize acorn parser.
super({
// TODO: use {...options} when spread is supported(Node.js >= 8.3.0).
// do not use spread, because we don't want to pass any unknown options to acorn
ecmaVersion: options.ecmaVersion,
sourceType: options.sourceType,
ranges: options.ranges,
locations: options.locations,
allowReserved: options.allowReserved,
// Truthy value is true for backward compatibility.
allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn),
allowReturnOutsideFunction: options.allowReturnOutsideFunction,
// Collect tokens
onToken: token => {
if (tokenTranslator) {
// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
tokenTranslator.onToken(token, this[STATE]);
tokenTranslator.onToken(token, state);
}
if (token.type !== tokTypes.eof) {
this[STATE].lastToken = token;
state.lastToken = token;
}
},
// Collect comments
onComment: (block, text, start, end, startLoc, endLoc) => {
if (this[STATE].comments) {
const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc);
if (state.comments) {
const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code);
this[STATE].comments.push(comment);
state.comments.push(comment);
}
}
}, code);
// Initialize internal state.
this[STATE] = {
tokens: tokenTranslator ? [] : null,
comments: options.comment === true ? [] : null,
impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5,
ecmaVersion: this.options.ecmaVersion,
jsxAttrValueToken: false,
lastToken: null
};
/*
* We put all of this data into a symbol property as a way to avoid
* potential naming conflicts with future versions of Acorn.
*/
this[STATE] = state;
}
tokenize() {
@ -143,7 +171,7 @@ module.exports = () => Parser => {
const extra = this[STATE];
const program = super.parse();
program.sourceType = this.options.sourceType;
program.sourceType = extra.originalSourceType;
if (extra.comments) {
program.comments = extra.comments;
@ -159,15 +187,59 @@ module.exports = () => Parser => {
* whitespace or leading comments). Acorn also counts trailing whitespace
* as part of the program whereas Esprima only counts up to the last token.
*/
if (program.range) {
program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0];
program.range[1] = extra.lastToken ? extra.lastToken.range[1] : program.range[1];
if (program.body.length) {
const [firstNode] = program.body;
if (program.range) {
program.range[0] = firstNode.range[0];
}
if (program.loc) {
program.loc.start = firstNode.loc.start;
}
program.start = firstNode.start;
}
if (program.loc) {
program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start;
program.loc.end = extra.lastToken ? extra.lastToken.loc.end : program.loc.end;
if (extra.lastToken) {
if (program.range) {
program.range[1] = extra.lastToken.range[1];
}
if (program.loc) {
program.loc.end = extra.lastToken.loc.end;
}
program.end = extra.lastToken.end;
}
/*
* https://github.com/eslint/espree/issues/349
* Ensure that template elements have correct range information.
* This is one location where Acorn produces a different value
* for its start and end properties vs. the values present in the
* range property. In order to avoid confusion, we set the start
* and end properties to the values that are present in range.
* This is done here, instead of in finishNode(), because Acorn
* uses the values of start and end internally while parsing, making
* it dangerous to change those values while parsing is ongoing.
* By waiting until the end of parsing, we can safely change these
* values without affect any other part of the process.
*/
this[STATE].templateElements.forEach(templateElement => {
const startOffset = -1;
const endOffset = templateElement.tail ? 1 : 2;
templateElement.start += startOffset;
templateElement.end += endOffset;
if (templateElement.range) {
templateElement.range[0] += startOffset;
templateElement.range[1] += endOffset;
}
if (templateElement.loc) {
templateElement.loc.start.column += startOffset;
templateElement.loc.end.column += endOffset;
}
});
return program;
}
@ -262,21 +334,11 @@ module.exports = () => Parser => {
// so we have to adjust ranges/locations appropriately.
if (result.type === "TemplateElement") {
// additional adjustment needed if ${ is the last token
const terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${";
if (result.range) {
result.range[0]--;
result.range[1] += (terminalDollarBraceL ? 2 : 1);
}
if (result.loc) {
result.loc.start.column--;
result.loc.end.column += (terminalDollarBraceL ? 2 : 1);
}
// save template element references to fix start/end later
this[STATE].templateElements.push(result);
}
if (result.type.indexOf("Function") > -1 && !result.generator) {
if (result.type.includes("Function") && !result.generator) {
result.generator = false;
}

View file

@ -4,8 +4,6 @@
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
@ -16,7 +14,7 @@
// Public
//------------------------------------------------------------------------------
module.exports = {
export default {
// React JSX parsing
jsx: false,

104
node_modules/espree/lib/options.js generated vendored
View file

@ -3,37 +3,53 @@
* @author Kai Cataldo
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const DEFAULT_ECMA_VERSION = 5;
const SUPPORTED_VERSIONS = [
3,
5,
6,
7,
8,
9,
10,
11,
12
6, // 2015
7, // 2016
8, // 2017
9, // 2018
10, // 2019
11, // 2020
12, // 2021
13, // 2022
14 // 2023
];
/**
* Get the latest ECMAScript version supported by Espree.
* @returns {number} The latest ECMAScript version.
*/
export function getLatestEcmaVersion() {
return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1];
}
/**
* Get the list of ECMAScript versions supported by Espree.
* @returns {number[]} An array containing the supported ECMAScript versions.
*/
export function getSupportedEcmaVersions() {
return [...SUPPORTED_VERSIONS];
}
/**
* Normalize ECMAScript version from the initial config
* @param {number} ecmaVersion ECMAScript version from the initial config
* @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config
* @throws {Error} throws an error if the ecmaVersion is invalid.
* @returns {number} normalized ECMAScript version
*/
function normalizeEcmaVersion(ecmaVersion = DEFAULT_ECMA_VERSION) {
if (typeof ecmaVersion !== "number") {
throw new Error(`ecmaVersion must be a number. Received value of type ${typeof ecmaVersion} instead.`);
}
function normalizeEcmaVersion(ecmaVersion = 5) {
let version = ecmaVersion;
let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;
if (typeof version !== "number") {
throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`);
}
// Calculate ECMAScript edition number from official year version starting with
// ES2015, which corresponds with ES6 (or a difference of 2009).
@ -58,6 +74,11 @@ function normalizeSourceType(sourceType = "script") {
if (sourceType === "script" || sourceType === "module") {
return sourceType;
}
if (sourceType === "commonjs") {
return "script";
}
throw new Error("Invalid sourceType.");
}
@ -67,40 +88,35 @@ function normalizeSourceType(sourceType = "script") {
* @throws {Error} throw an error if found invalid option.
* @returns {Object} normalized options
*/
function normalizeOptions(options) {
export function normalizeOptions(options) {
const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
const sourceType = normalizeSourceType(options.sourceType);
const ranges = options.range === true;
const locations = options.loc === true;
if (ecmaVersion !== 3 && options.allowReserved) {
// a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
throw new Error("`allowReserved` is only supported when ecmaVersion is 3");
}
if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") {
throw new Error("`allowReserved`, when present, must be `true` or `false`");
}
const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false;
const ecmaFeatures = options.ecmaFeatures || {};
const allowReturnOutsideFunction = options.sourceType === "commonjs" ||
Boolean(ecmaFeatures.globalReturn);
if (sourceType === "module" && ecmaVersion < 6) {
throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");
}
return Object.assign({}, options, { ecmaVersion, sourceType, ranges, locations });
return Object.assign({}, options, {
ecmaVersion,
sourceType,
ranges,
locations,
allowReserved,
allowReturnOutsideFunction
});
}
/**
* Get the latest ECMAScript version supported by Espree.
* @returns {number} The latest ECMAScript version.
*/
function getLatestEcmaVersion() {
return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1];
}
/**
* Get the list of ECMAScript versions supported by Espree.
* @returns {number[]} An array containing the supported ECMAScript versions.
*/
function getSupportedEcmaVersions() {
return [...SUPPORTED_VERSIONS];
}
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
module.exports = {
normalizeOptions,
getLatestEcmaVersion,
getSupportedEcmaVersions
};

View file

@ -4,8 +4,6 @@
*/
/* eslint no-underscore-dangle: 0 */
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
@ -22,6 +20,7 @@ const Token = {
Boolean: "Boolean",
EOF: "<end>",
Identifier: "Identifier",
PrivateIdentifier: "PrivateIdentifier",
Keyword: "Keyword",
Null: "Null",
Numeric: "Numeric",
@ -116,6 +115,9 @@ TokenTranslator.prototype = {
token.type = Token.Keyword;
}
} else if (type === tt.privateId) {
token.type = Token.PrivateIdentifier;
} else if (type === tt.semi || type === tt.comma ||
type === tt.parenL || type === tt.parenR ||
type === tt.braceL || type === tt.braceR ||
@ -260,4 +262,4 @@ TokenTranslator.prototype = {
// Public
//------------------------------------------------------------------------------
module.exports = TokenTranslator;
export default TokenTranslator;

3
node_modules/espree/lib/version.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
const version = "9.4.1";
export default version;

View file

@ -1,123 +0,0 @@
/**
* @fileoverview The visitor keys for the node types Espree supports
* @author Nicholas C. Zakas
*
* This file contains code from estraverse-fb.
*
* The MIT license. Copyright (c) 2014 Ingvar Stepanyan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
// None!
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
module.exports = {
// ECMAScript
AssignmentExpression: ["left", "right"],
AssignmentPattern: ["left", "right"],
ArrayExpression: ["elements"],
ArrayPattern: ["elements"],
ArrowFunctionExpression: ["params", "body"],
BlockStatement: ["body"],
BinaryExpression: ["left", "right"],
BreakStatement: ["label"],
CallExpression: ["callee", "arguments"],
CatchClause: ["param", "body"],
ClassBody: ["body"],
ClassDeclaration: ["id", "superClass", "body"],
ClassExpression: ["id", "superClass", "body"],
ConditionalExpression: ["test", "consequent", "alternate"],
ContinueStatement: ["label"],
DebuggerStatement: [],
DirectiveStatement: [],
DoWhileStatement: ["body", "test"],
EmptyStatement: [],
ExportAllDeclaration: ["source"],
ExportDefaultDeclaration: ["declaration"],
ExportNamedDeclaration: ["declaration", "specifiers", "source"],
ExportSpecifier: ["exported", "local"],
ExpressionStatement: ["expression"],
ForStatement: ["init", "test", "update", "body"],
ForInStatement: ["left", "right", "body"],
ForOfStatement: ["left", "right", "body"],
FunctionDeclaration: ["id", "params", "body"],
FunctionExpression: ["id", "params", "body"],
Identifier: [],
IfStatement: ["test", "consequent", "alternate"],
ImportDeclaration: ["specifiers", "source"],
ImportDefaultSpecifier: ["local"],
ImportNamespaceSpecifier: ["local"],
ImportSpecifier: ["imported", "local"],
Literal: [],
LabeledStatement: ["label", "body"],
LogicalExpression: ["left", "right"],
MemberExpression: ["object", "property"],
MetaProperty: ["meta", "property"],
MethodDefinition: ["key", "value"],
ModuleSpecifier: [],
NewExpression: ["callee", "arguments"],
ObjectExpression: ["properties"],
ObjectPattern: ["properties"],
Program: ["body"],
Property: ["key", "value"],
RestElement: ["argument"],
ReturnStatement: ["argument"],
SequenceExpression: ["expressions"],
SpreadElement: ["argument"],
Super: [],
SwitchStatement: ["discriminant", "cases"],
SwitchCase: ["test", "consequent"],
TaggedTemplateExpression: ["tag", "quasi"],
TemplateElement: [],
TemplateLiteral: ["quasis", "expressions"],
ThisExpression: [],
ThrowStatement: ["argument"],
TryStatement: ["block", "handler", "finalizer"],
UnaryExpression: ["argument"],
UpdateExpression: ["argument"],
VariableDeclaration: ["declarations"],
VariableDeclarator: ["id", "init"],
WhileStatement: ["test", "body"],
WithStatement: ["object", "body"],
YieldExpression: ["argument"],
// JSX
JSXIdentifier: [],
JSXNamespacedName: ["namespace", "name"],
JSXMemberExpression: ["object", "property"],
JSXEmptyExpression: [],
JSXExpressionContainer: ["expression"],
JSXElement: ["openingElement", "closingElement", "children"],
JSXClosingElement: ["name"],
JSXOpeningElement: ["name", "attributes"],
JSXAttribute: ["name", "value"],
JSXText: null,
JSXSpreadAttribute: ["argument"]
};

View file

@ -1,25 +0,0 @@
v1.3.0 - June 19, 2020
* [`c92dd7f`](https://github.com/eslint/eslint-visitor-keys/commit/c92dd7ff96f0044dba12d681406a025b92b4c437) Update: add `ChainExpression` node (#12) (Toru Nagashima)
v1.2.0 - June 4, 2020
* [`21f28bf`](https://github.com/eslint/eslint-visitor-keys/commit/21f28bf11be5329d740a8bf6bdbcd0ef13bbf1a2) Update: added exported in exportAllDeclaration key (#10) (Anix)
v1.1.0 - August 13, 2019
* [`9331cc0`](https://github.com/eslint/eslint-visitor-keys/commit/9331cc09e756e65b9044c9186445a474b037fac6) Update: add ImportExpression (#8) (Toru Nagashima)
* [`5967f58`](https://github.com/eslint/eslint-visitor-keys/commit/5967f583b04f17fba9226aaa394e45d476d2b8af) Chore: add supported Node.js versions to CI (#7) (Kai Cataldo)
* [`6f7c60f`](https://github.com/eslint/eslint-visitor-keys/commit/6f7c60fef2ceec9f6323202df718321cec45cab0) Upgrade: eslint-release@1.0.0 (#5) (Teddy Katz)
v1.0.0 - December 18, 2017
* 1f6bd38 Breaking: update keys (#4) (Toru Nagashima)
v0.1.0 - November 17, 2017
* 17b4a88 Chore: update `repository` field in package.json (#3) (Toru Nagashima)
* a5a026b New: eslint-visitor-keys (#1) (Toru Nagashima)
* a1a48b8 Update: Change license to Apache 2 (#2) (Ilya Volodin)
* 2204715 Initial commit (Toru Nagashima)

View file

@ -17,10 +17,19 @@ $ npm install eslint-visitor-keys
### Requirements
- [Node.js] 4.0.0 or later.
- [Node.js] `^12.22.0`, `^14.17.0`, or `>=16.0.0`
## 📖 Usage
To use in an ESM file:
```js
import * as evk from "eslint-visitor-keys"
```
To use in a CommonJS file:
```js
const evk = require("eslint-visitor-keys")
```
@ -51,7 +60,7 @@ This will be used to traverse unknown nodes.
For example:
```
```js
const node = {
type: "AssignmentExpression",
left: { type: "Identifier", name: "foo" },
@ -71,7 +80,7 @@ Make the union set with `evk.KEYS` and the given keys.
For example:
```
```js
console.log(evk.unionWith({
MethodDefinition: ["decorators"]
})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... }
@ -94,5 +103,5 @@ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-
[npm]: https://www.npmjs.com/
[Node.js]: https://nodejs.org/en/
[Node.js]: https://nodejs.org/
[ESTree]: https://github.com/estree/estree

View file

@ -0,0 +1,382 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
/**
* @typedef {import('./index.js').VisitorKeys} VisitorKeys
*/
/**
* @type {VisitorKeys}
*/
const KEYS = {
AssignmentExpression: [
"left",
"right"
],
AssignmentPattern: [
"left",
"right"
],
ArrayExpression: [
"elements"
],
ArrayPattern: [
"elements"
],
ArrowFunctionExpression: [
"params",
"body"
],
AwaitExpression: [
"argument"
],
BlockStatement: [
"body"
],
BinaryExpression: [
"left",
"right"
],
BreakStatement: [
"label"
],
CallExpression: [
"callee",
"arguments"
],
CatchClause: [
"param",
"body"
],
ChainExpression: [
"expression"
],
ClassBody: [
"body"
],
ClassDeclaration: [
"id",
"superClass",
"body"
],
ClassExpression: [
"id",
"superClass",
"body"
],
ConditionalExpression: [
"test",
"consequent",
"alternate"
],
ContinueStatement: [
"label"
],
DebuggerStatement: [],
DoWhileStatement: [
"body",
"test"
],
EmptyStatement: [],
ExportAllDeclaration: [
"exported",
"source"
],
ExportDefaultDeclaration: [
"declaration"
],
ExportNamedDeclaration: [
"declaration",
"specifiers",
"source"
],
ExportSpecifier: [
"exported",
"local"
],
ExpressionStatement: [
"expression"
],
ExperimentalRestProperty: [
"argument"
],
ExperimentalSpreadProperty: [
"argument"
],
ForStatement: [
"init",
"test",
"update",
"body"
],
ForInStatement: [
"left",
"right",
"body"
],
ForOfStatement: [
"left",
"right",
"body"
],
FunctionDeclaration: [
"id",
"params",
"body"
],
FunctionExpression: [
"id",
"params",
"body"
],
Identifier: [],
IfStatement: [
"test",
"consequent",
"alternate"
],
ImportDeclaration: [
"specifiers",
"source"
],
ImportDefaultSpecifier: [
"local"
],
ImportExpression: [
"source"
],
ImportNamespaceSpecifier: [
"local"
],
ImportSpecifier: [
"imported",
"local"
],
JSXAttribute: [
"name",
"value"
],
JSXClosingElement: [
"name"
],
JSXElement: [
"openingElement",
"children",
"closingElement"
],
JSXEmptyExpression: [],
JSXExpressionContainer: [
"expression"
],
JSXIdentifier: [],
JSXMemberExpression: [
"object",
"property"
],
JSXNamespacedName: [
"namespace",
"name"
],
JSXOpeningElement: [
"name",
"attributes"
],
JSXSpreadAttribute: [
"argument"
],
JSXText: [],
JSXFragment: [
"openingFragment",
"children",
"closingFragment"
],
JSXClosingFragment: [],
JSXOpeningFragment: [],
Literal: [],
LabeledStatement: [
"label",
"body"
],
LogicalExpression: [
"left",
"right"
],
MemberExpression: [
"object",
"property"
],
MetaProperty: [
"meta",
"property"
],
MethodDefinition: [
"key",
"value"
],
NewExpression: [
"callee",
"arguments"
],
ObjectExpression: [
"properties"
],
ObjectPattern: [
"properties"
],
PrivateIdentifier: [],
Program: [
"body"
],
Property: [
"key",
"value"
],
PropertyDefinition: [
"key",
"value"
],
RestElement: [
"argument"
],
ReturnStatement: [
"argument"
],
SequenceExpression: [
"expressions"
],
SpreadElement: [
"argument"
],
StaticBlock: [
"body"
],
Super: [],
SwitchStatement: [
"discriminant",
"cases"
],
SwitchCase: [
"test",
"consequent"
],
TaggedTemplateExpression: [
"tag",
"quasi"
],
TemplateElement: [],
TemplateLiteral: [
"quasis",
"expressions"
],
ThisExpression: [],
ThrowStatement: [
"argument"
],
TryStatement: [
"block",
"handler",
"finalizer"
],
UnaryExpression: [
"argument"
],
UpdateExpression: [
"argument"
],
VariableDeclaration: [
"declarations"
],
VariableDeclarator: [
"id",
"init"
],
WhileStatement: [
"test",
"body"
],
WithStatement: [
"object",
"body"
],
YieldExpression: [
"argument"
]
};
// Types.
const NODE_TYPES = Object.keys(KEYS);
// Freeze the keys.
for (const type of NODE_TYPES) {
Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
/**
* @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
*/
// List to ignore keys.
const KEY_BLACKLIST = new Set([
"parent",
"leadingComments",
"trailingComments"
]);
/**
* Check whether a given key should be used or not.
* @param {string} key The key to check.
* @returns {boolean} `true` if the key should be used.
*/
function filterKey(key) {
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}
/**
* Get visitor keys of a given node.
* @param {object} node The AST node to get keys.
* @returns {readonly string[]} Visitor keys of the node.
*/
function getKeys(node) {
return Object.keys(node).filter(filterKey);
}
// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
// eslint-disable-next-line valid-jsdoc
/**
* Make the union set with `KEYS` and given keys.
* @param {VisitorKeys} additionalKeys The additional keys.
* @returns {VisitorKeys} The union set.
*/
function unionWith(additionalKeys) {
const retv = /** @type {{
[type: string]: ReadonlyArray<string>
}} */ (Object.assign({}, KEYS));
for (const type of Object.keys(additionalKeys)) {
if (Object.prototype.hasOwnProperty.call(retv, type)) {
const keys = new Set(additionalKeys[type]);
for (const key of retv[type]) {
keys.add(key);
}
retv[type] = Object.freeze(Array.from(keys));
} else {
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
}
}
return Object.freeze(retv);
}
exports.KEYS = KEYS;
exports.getKeys = getKeys;
exports.unionWith = unionWith;
//# sourceMappingURL=eslint-visitor-keys.cjs.map

View file

@ -0,0 +1,18 @@
/**
* Get visitor keys of a given node.
* @param {object} node The AST node to get keys.
* @returns {readonly string[]} Visitor keys of the node.
*/
export function getKeys(node: object): readonly string[];
/**
* Make the union set with `KEYS` and given keys.
* @param {VisitorKeys} additionalKeys The additional keys.
* @returns {VisitorKeys} The union set.
*/
export function unionWith(additionalKeys: VisitorKeys): VisitorKeys;
export { KEYS };
export type VisitorKeys = {
readonly [type: string]: readonly string[];
};
import KEYS from "./visitor-keys.js";
//# sourceMappingURL=index.d.ts.map

View file

@ -0,0 +1,10 @@
export default KEYS;
export type VisitorKeys = import('./index.js').VisitorKeys;
/**
* @typedef {import('./index.js').VisitorKeys} VisitorKeys
*/
/**
* @type {VisitorKeys}
*/
declare const KEYS: VisitorKeys;
//# sourceMappingURL=visitor-keys.d.ts.map

View file

@ -2,18 +2,11 @@
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict";
import KEYS from "./visitor-keys.js";
const KEYS = require("./visitor-keys.json");
// Types.
const NODE_TYPES = Object.freeze(Object.keys(KEYS));
// Freeze the keys.
for (const type of NODE_TYPES) {
Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);
/**
* @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
*/
// List to ignore keys.
const KEY_BLACKLIST = new Set([
@ -31,51 +24,42 @@ function filterKey(key) {
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}
//------------------------------------------------------------------------------
// Public interfaces
//------------------------------------------------------------------------------
/**
* Get visitor keys of a given node.
* @param {object} node The AST node to get keys.
* @returns {readonly string[]} Visitor keys of the node.
*/
export function getKeys(node) {
return Object.keys(node).filter(filterKey);
}
module.exports = Object.freeze({
// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
// eslint-disable-next-line valid-jsdoc
/**
* Make the union set with `KEYS` and given keys.
* @param {VisitorKeys} additionalKeys The additional keys.
* @returns {VisitorKeys} The union set.
*/
export function unionWith(additionalKeys) {
const retv = /** @type {{
[type: string]: ReadonlyArray<string>
}} */ (Object.assign({}, KEYS));
/**
* Visitor keys.
* @type {{ [type: string]: string[] | undefined }}
*/
KEYS,
for (const type of Object.keys(additionalKeys)) {
if (Object.prototype.hasOwnProperty.call(retv, type)) {
const keys = new Set(additionalKeys[type]);
/**
* Get visitor keys of a given node.
* @param {Object} node The AST node to get keys.
* @returns {string[]} Visitor keys of the node.
*/
getKeys(node) {
return Object.keys(node).filter(filterKey);
},
// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
// eslint-disable-next-line valid-jsdoc
/**
* Make the union set with `KEYS` and given keys.
* @param {Object} additionalKeys The additional keys.
* @returns {{ [type: string]: string[] | undefined }} The union set.
*/
unionWith(additionalKeys) {
const retv = Object.assign({}, KEYS);
for (const type of Object.keys(additionalKeys)) {
if (retv.hasOwnProperty(type)) {
const keys = new Set(additionalKeys[type]);
for (const key of retv[type]) {
keys.add(key);
}
retv[type] = Object.freeze(Array.from(keys));
} else {
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
for (const key of retv[type]) {
keys.add(key);
}
}
return Object.freeze(retv);
retv[type] = Object.freeze(Array.from(keys));
} else {
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
}
}
});
return Object.freeze(retv);
}
export { KEYS };

View file

@ -1,284 +1,312 @@
{
"AssignmentExpression": [
/**
* @typedef {import('./index.js').VisitorKeys} VisitorKeys
*/
/**
* @type {VisitorKeys}
*/
const KEYS = {
AssignmentExpression: [
"left",
"right"
],
"AssignmentPattern": [
AssignmentPattern: [
"left",
"right"
],
"ArrayExpression": [
ArrayExpression: [
"elements"
],
"ArrayPattern": [
ArrayPattern: [
"elements"
],
"ArrowFunctionExpression": [
ArrowFunctionExpression: [
"params",
"body"
],
"AwaitExpression": [
AwaitExpression: [
"argument"
],
"BlockStatement": [
BlockStatement: [
"body"
],
"BinaryExpression": [
BinaryExpression: [
"left",
"right"
],
"BreakStatement": [
BreakStatement: [
"label"
],
"CallExpression": [
CallExpression: [
"callee",
"arguments"
],
"CatchClause": [
CatchClause: [
"param",
"body"
],
"ChainExpression": [
ChainExpression: [
"expression"
],
"ClassBody": [
ClassBody: [
"body"
],
"ClassDeclaration": [
ClassDeclaration: [
"id",
"superClass",
"body"
],
"ClassExpression": [
ClassExpression: [
"id",
"superClass",
"body"
],
"ConditionalExpression": [
ConditionalExpression: [
"test",
"consequent",
"alternate"
],
"ContinueStatement": [
ContinueStatement: [
"label"
],
"DebuggerStatement": [],
"DoWhileStatement": [
DebuggerStatement: [],
DoWhileStatement: [
"body",
"test"
],
"EmptyStatement": [],
"ExportAllDeclaration": [
EmptyStatement: [],
ExportAllDeclaration: [
"exported",
"source"
],
"ExportDefaultDeclaration": [
ExportDefaultDeclaration: [
"declaration"
],
"ExportNamedDeclaration": [
ExportNamedDeclaration: [
"declaration",
"specifiers",
"source"
],
"ExportSpecifier": [
ExportSpecifier: [
"exported",
"local"
],
"ExpressionStatement": [
ExpressionStatement: [
"expression"
],
"ExperimentalRestProperty": [
ExperimentalRestProperty: [
"argument"
],
"ExperimentalSpreadProperty": [
ExperimentalSpreadProperty: [
"argument"
],
"ForStatement": [
ForStatement: [
"init",
"test",
"update",
"body"
],
"ForInStatement": [
ForInStatement: [
"left",
"right",
"body"
],
"ForOfStatement": [
ForOfStatement: [
"left",
"right",
"body"
],
"FunctionDeclaration": [
FunctionDeclaration: [
"id",
"params",
"body"
],
"FunctionExpression": [
FunctionExpression: [
"id",
"params",
"body"
],
"Identifier": [],
"IfStatement": [
Identifier: [],
IfStatement: [
"test",
"consequent",
"alternate"
],
"ImportDeclaration": [
ImportDeclaration: [
"specifiers",
"source"
],
"ImportDefaultSpecifier": [
ImportDefaultSpecifier: [
"local"
],
"ImportExpression": [
ImportExpression: [
"source"
],
"ImportNamespaceSpecifier": [
ImportNamespaceSpecifier: [
"local"
],
"ImportSpecifier": [
ImportSpecifier: [
"imported",
"local"
],
"JSXAttribute": [
JSXAttribute: [
"name",
"value"
],
"JSXClosingElement": [
JSXClosingElement: [
"name"
],
"JSXElement": [
JSXElement: [
"openingElement",
"children",
"closingElement"
],
"JSXEmptyExpression": [],
"JSXExpressionContainer": [
JSXEmptyExpression: [],
JSXExpressionContainer: [
"expression"
],
"JSXIdentifier": [],
"JSXMemberExpression": [
JSXIdentifier: [],
JSXMemberExpression: [
"object",
"property"
],
"JSXNamespacedName": [
JSXNamespacedName: [
"namespace",
"name"
],
"JSXOpeningElement": [
JSXOpeningElement: [
"name",
"attributes"
],
"JSXSpreadAttribute": [
JSXSpreadAttribute: [
"argument"
],
"JSXText": [],
"JSXFragment": [
JSXText: [],
JSXFragment: [
"openingFragment",
"children",
"closingFragment"
],
"Literal": [],
"LabeledStatement": [
JSXClosingFragment: [],
JSXOpeningFragment: [],
Literal: [],
LabeledStatement: [
"label",
"body"
],
"LogicalExpression": [
LogicalExpression: [
"left",
"right"
],
"MemberExpression": [
MemberExpression: [
"object",
"property"
],
"MetaProperty": [
MetaProperty: [
"meta",
"property"
],
"MethodDefinition": [
MethodDefinition: [
"key",
"value"
],
"NewExpression": [
NewExpression: [
"callee",
"arguments"
],
"ObjectExpression": [
ObjectExpression: [
"properties"
],
"ObjectPattern": [
ObjectPattern: [
"properties"
],
"Program": [
PrivateIdentifier: [],
Program: [
"body"
],
"Property": [
Property: [
"key",
"value"
],
"RestElement": [
PropertyDefinition: [
"key",
"value"
],
RestElement: [
"argument"
],
"ReturnStatement": [
ReturnStatement: [
"argument"
],
"SequenceExpression": [
SequenceExpression: [
"expressions"
],
"SpreadElement": [
SpreadElement: [
"argument"
],
"Super": [],
"SwitchStatement": [
StaticBlock: [
"body"
],
Super: [],
SwitchStatement: [
"discriminant",
"cases"
],
"SwitchCase": [
SwitchCase: [
"test",
"consequent"
],
"TaggedTemplateExpression": [
TaggedTemplateExpression: [
"tag",
"quasi"
],
"TemplateElement": [],
"TemplateLiteral": [
TemplateElement: [],
TemplateLiteral: [
"quasis",
"expressions"
],
"ThisExpression": [],
"ThrowStatement": [
ThisExpression: [],
ThrowStatement: [
"argument"
],
"TryStatement": [
TryStatement: [
"block",
"handler",
"finalizer"
],
"UnaryExpression": [
UnaryExpression: [
"argument"
],
"UpdateExpression": [
UpdateExpression: [
"argument"
],
"VariableDeclaration": [
VariableDeclaration: [
"declarations"
],
"VariableDeclarator": [
VariableDeclarator: [
"id",
"init"
],
"WhileStatement": [
WhileStatement: [
"test",
"body"
],
"WithStatement": [
WithStatement: [
"object",
"body"
],
"YieldExpression": [
YieldExpression: [
"argument"
]
};
// Types.
const NODE_TYPES = Object.keys(KEYS);
// Freeze the keys.
for (const type of NODE_TYPES) {
Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);
export default KEYS;

View file

@ -1,28 +1,50 @@
{
"name": "eslint-visitor-keys",
"version": "1.3.0",
"version": "3.3.0",
"description": "Constants and utilities about visitor keys to traverse AST.",
"main": "lib/index.js",
"type": "module",
"main": "dist/eslint-visitor-keys.cjs",
"types": "./dist/index.d.ts",
"exports": {
".": [
{
"import": "./lib/index.js",
"require": "./dist/eslint-visitor-keys.cjs"
},
"./dist/eslint-visitor-keys.cjs"
],
"./package.json": "./package.json"
},
"files": [
"dist/index.d.ts",
"dist/visitor-keys.d.ts",
"dist/eslint-visitor-keys.cjs",
"lib"
],
"engines": {
"node": ">=4"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"dependencies": {},
"devDependencies": {
"eslint": "^4.7.2",
"eslint-config-eslint": "^4.0.0",
"eslint-release": "^1.0.0",
"mocha": "^3.5.3",
"nyc": "^11.2.1",
"opener": "^1.4.3"
"c8": "^7.7.3",
"eslint": "^7.29.0",
"eslint-config-eslint": "^7.0.0",
"eslint-plugin-jsdoc": "^35.4.0",
"eslint-plugin-node": "^11.1.0",
"eslint-release": "^3.2.0",
"mocha": "^9.0.1",
"opener": "^1.5.2",
"rollup": "^2.52.1",
"tsd": "^0.19.1",
"typescript": "^4.5.5"
},
"scripts": {
"lint": "eslint lib tests/lib",
"pretest": "npm run -s lint",
"test": "nyc mocha tests/lib",
"coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
"prepare": "npm run build",
"build": "rollup -c && npm run tsc",
"lint": "eslint .",
"tsc": "tsc",
"tsd": "tsd",
"test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run tsd",
"coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html",
"generate-release": "eslint-generate-release",
"generate-alpharelease": "eslint-generate-prerelease alpha",
"generate-betarelease": "eslint-generate-prerelease beta",

74
node_modules/espree/package.json generated vendored
View file

@ -3,42 +3,55 @@
"description": "An Esprima-compatible JavaScript parser built on Acorn",
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
"homepage": "https://github.com/eslint/espree",
"main": "espree.js",
"version": "7.3.1",
"main": "dist/espree.cjs",
"type": "module",
"exports": {
".": [
{
"import": "./espree.js",
"require": "./dist/espree.cjs",
"default": "./dist/espree.cjs"
},
"./dist/espree.cjs"
],
"./package.json": "./package.json"
},
"version": "9.4.1",
"files": [
"lib",
"dist/espree.cjs",
"espree.js"
],
"engines": {
"node": "^10.12.0 || >=12.0.0"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"repository": "eslint/espree",
"bugs": {
"url": "http://github.com/eslint/espree.git"
"url": "https://github.com/eslint/espree/issues"
},
"funding": "https://opencollective.com/eslint",
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^7.4.0",
"acorn-jsx": "^5.3.1",
"eslint-visitor-keys": "^1.3.0"
"acorn": "^8.8.0",
"acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^3.3.0"
},
"devDependencies": {
"browserify": "^16.5.0",
"chai": "^4.2.0",
"eslint": "^6.0.1",
"eslint-config-eslint": "^5.0.1",
"eslint-plugin-node": "^9.1.0",
"eslint-release": "^1.0.0",
"esprima": "latest",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"c8": "^7.11.0",
"chai": "^4.3.6",
"eslint": "^8.13.0",
"eslint-config-eslint": "^7.0.0",
"eslint-plugin-jsdoc": "^39.2.4",
"eslint-plugin-node": "^11.1.0",
"eslint-release": "^3.2.0",
"esprima-fb": "^8001.2001.0-dev-harmony-fb",
"json-diff": "^0.5.4",
"leche": "^2.3.0",
"mocha": "^6.2.0",
"nyc": "^14.1.1",
"regenerate": "^1.4.0",
"shelljs": "^0.3.0",
"shelljs-nodecli": "^0.1.1",
"unicode-6.3.0": "^0.7.5"
"mocha": "^9.2.2",
"npm-run-all": "^4.1.5",
"rollup": "^2.41.2",
"shelljs": "^0.3.0"
},
"keywords": [
"ast",
@ -49,12 +62,17 @@
"acorn"
],
"scripts": {
"generate-regex": "node tools/generate-identifier-regex.js",
"test": "npm run-script lint && node Makefile.js test",
"lint": "node Makefile.js lint",
"fixlint": "node Makefile.js lint --fix",
"sync-docs": "node Makefile.js docs",
"browserify": "node Makefile.js browserify",
"unit": "npm-run-all -s unit:*",
"unit:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'",
"unit:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs",
"test": "npm-run-all -p unit lint",
"lint": "eslint .",
"fixlint": "npm run lint -- --fix",
"build": "rollup -c rollup.config.js",
"update-version": "node tools/update-version.js",
"pretest": "npm run build",
"prepublishOnly": "npm run update-version && npm run build",
"sync-docs": "node sync-docs.js",
"generate-release": "eslint-generate-release",
"generate-alpharelease": "eslint-generate-prerelease alpha",
"generate-betarelease": "eslint-generate-prerelease beta",