mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
1449f183bd
> ℹ️ **Note** > > This PR body was truncated due to platform limits. This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Adoption](https://docs.renovatebot.com/merge-confidence/) | [Passing](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---|---|---| | [@babel/code-frame](https://babel.dev/docs/en/next/babel-code-frame) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-code-frame)) | [`^7.28.6` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fcode-frame/7.29.7/8.0.0) |  |  |  |  | | [@babel/core](https://babel.dev/docs/en/next/babel-core) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-core)) | [`^7.26.0` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fcore/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-external-helpers](https://babel.dev/docs/en/next/babel-plugin-external-helpers) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-external-helpers)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-external-helpers/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-proposal-decorators](https://babel.dev/docs/en/next/babel-plugin-proposal-decorators) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-decorators)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-proposal-decorators/7.29.7/8.0.2) |  |  |  |  | | [@babel/plugin-transform-arrow-functions](https://babel.dev/docs/en/next/babel-plugin-transform-arrow-functions) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-arrow-functions)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-arrow-functions/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-async-to-generator](https://babel.dev/docs/en/next/babel-plugin-transform-async-to-generator) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-async-to-generator)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-async-to-generator/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-class-properties](https://babel.dev/docs/en/next/babel-plugin-transform-class-properties) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-properties)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-class-properties/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-class-static-block](https://babel.dev/docs/en/next/babel-plugin-transform-class-static-block) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block)) | [`^7.26.0` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-class-static-block/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-explicit-resource-management](https://babel.dev/docs/en/next/babel-plugin-transform-explicit-resource-management) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-explicit-resource-management)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-explicit-resource-management/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-exponentiation-operator](https://babel.dev/docs/en/next/babel-plugin-transform-exponentiation-operator) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-exponentiation-operator)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-exponentiation-operator/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-logical-assignment-operators](https://babel.dev/docs/en/next/babel-plugin-transform-logical-assignment-operators) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-logical-assignment-operators)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-logical-assignment-operators/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-optional-chaining](https://babel.dev/docs/en/next/babel-plugin-transform-optional-chaining) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-optional-chaining)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-optional-chaining/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-private-methods](https://babel.dev/docs/en/next/babel-plugin-transform-private-methods) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-private-methods)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-private-methods/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-private-property-in-object](https://babel.dev/docs/en/next/babel-plugin-transform-private-property-in-object) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-private-property-in-object)) | [`^7.25.9` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-private-property-in-object/7.29.7/8.0.1) |  |  |  |  | | [@babel/plugin-transform-typescript](https://babel.dev/docs/en/next/babel-plugin-transform-typescript) ([source](https://redirect.github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-typescript)) | [`^7.26.3` → `^8.0.0`](https://renovatebot.com/diffs/npm/@babel%2fplugin-transform-typescript/7.29.7/8.0.1) |  |  |  |  | | [eslint](https://eslint.org) ([source](https://redirect.github.com/eslint/eslint)) | [`^9.13.0` → `^10.0.0`](https://renovatebot.com/diffs/npm/eslint/9.39.4/10.5.0) |  |  |  |  | --- ### Release Notes <details> <summary>babel/babel (@​babel/code-frame)</summary> ### [`v8.0.0`](https://redirect.github.com/babel/babel/blob/HEAD/CHANGELOG.md#v800-2026-06-16) [Compare Source](https://redirect.github.com/babel/babel/compare/v7.29.7...v8.0.0) ##### 👓 Spec Compliance - `babel-core` - [#​18039](https://redirect.github.com/babel/babel/pull/18039) perf: Only extract source map comments at the end of the file ([@​liuxingbaoyu](https://redirect.github.com/liuxingbaoyu)) ##### 💥 Breaking Change - `babel-cli`, `babel-node`, `babel-plugin-proposal-decorators`, `babel-plugin-transform-classes`, `babel-plugin-transform-function-name`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-object-rest-spread`, `babel-plugin-transform-parameters`, `babel-plugin-transform-react-constant-elements`, `babel-plugin-transform-regenerator`, `babel-preset-env`, `babel-register` - [#​18069](https://redirect.github.com/babel/babel/pull/18069) Fallback to assuming ESM support with `modules: auto` ([@​nicolo-ribaudo](https://redirect.github.com/nicolo-ribaudo)) - `babel-plugin-transform-runtime`, `babel-runtime-corejs3`, `babel-runtime` - [#​18036](https://redirect.github.com/babel/babel/pull/18036) Remove corejs exports for `@babe/runtime-corejs3` ([@​liuxingbaoyu](https://redirect.github.com/liuxingbaoyu)) - `babel-parser` - [#​18034](https://redirect.github.com/babel/babel/pull/18034) Remove `locations: "packed"` ([@​liuxingbaoyu](https://redirect.github.com/liuxingbaoyu)) ##### 🐛 Bug Fix - `babel-generator` - [#​18046](https://redirect.github.com/babel/babel/pull/18046) fix(generator): improve new callee parens check ([@​JLHwung](https://redirect.github.com/JLHwung)) - `babel-plugin-transform-modules-systemjs` - [#​18032](https://redirect.github.com/babel/babel/pull/18032) fix(systemjs): support **proto** as an export name ([@​JLHwung](https://redirect.github.com/JLHwung)) ##### 📝 Documentation - [#​18070](https://redirect.github.com/babel/babel/pull/18070) Add EOL date for Babel 7 (end of June 2027) to SECURITY.md ([@​nicolo-ribaudo](https://redirect.github.com/nicolo-ribaudo)) ##### 🏠 Internal - [#​18018](https://redirect.github.com/babel/babel/pull/18018) ci: enforce yarn integrity ([@​JLHwung](https://redirect.github.com/JLHwung)) ##### :running\_woman: Performance - `babel-core` - [#​18039](https://redirect.github.com/babel/babel/pull/18039) perf: Only extract source map comments at the end of the file ([@​liuxingbaoyu](https://redirect.github.com/liuxingbaoyu)) </details> <details> <summary>eslint/eslint (eslint)</summary> ### [`v10.5.0`](https://redirect.github.com/eslint/eslint/releases/tag/v10.5.0) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.4.1...v10.5.0) #### Features - [`5ca8c52`](https://redirect.github.com/eslint/eslint/commit/5ca8c5278edea1fd84d3ba83d8ea3f52fb3831ad) feat: correct stack tracking in max-nested-callbacks ([#​20973](https://redirect.github.com/eslint/eslint/issues/20973)) (Pixel998) - [`b565783`](https://redirect.github.com/eslint/eslint/commit/b5657837604fa5e8cf1278074782025cadd34b6c) feat: report no-with violations at the with keyword ([#​20971](https://redirect.github.com/eslint/eslint/issues/20971)) (Pixel998) - [`2ce032f`](https://redirect.github.com/eslint/eslint/commit/2ce032fbc72a1a80c024c084a4f382fb6dece684) feat: report max-lines-per-function violations at function head ([#​20966](https://redirect.github.com/eslint/eslint/issues/20966)) (Pixel998) - [`732cb3e`](https://redirect.github.com/eslint/eslint/commit/732cb3e09d5b8b809b5f461d118a5d9fdcd6427f) feat: report max-nested-callbacks violations at function head ([#​20967](https://redirect.github.com/eslint/eslint/issues/20967)) (Pixel998) - [`f9c138a`](https://redirect.github.com/eslint/eslint/commit/f9c138a0ba7d8e37aed39aef4a3ff1cae8c669f7) feat: report max-depth violations on keywords ([#​20943](https://redirect.github.com/eslint/eslint/issues/20943)) (Pixel998) - [`bdb496c`](https://redirect.github.com/eslint/eslint/commit/bdb496cc0d54b6d0a023aef9abd5f040ccff2101) feat: correct max-depth handling for else-if chains ([#​20944](https://redirect.github.com/eslint/eslint/issues/20944)) (Pixel998) - [`c296873`](https://redirect.github.com/eslint/eslint/commit/c29687354a7f96093f57f7d73eecb866ad5e2953) feat: update error loc in `max-statements` to function header ([#​20907](https://redirect.github.com/eslint/eslint/issues/20907)) (Taejin Kim) #### Documentation - [`8ae1b5b`](https://redirect.github.com/eslint/eslint/commit/8ae1b5b856dc031cd6c701d89a4df7da4772cd56) docs: Update README (GitHub Actions Bot) - [`ca7eb90`](https://redirect.github.com/eslint/eslint/commit/ca7eb90127dcad917188bb1342623f02a272e781) docs: update Node.js prerequisites to include ICU support ([#​20962](https://redirect.github.com/eslint/eslint/issues/20962)) (Francesco Trotta) - [`f99b47a`](https://redirect.github.com/eslint/eslint/commit/f99b47a6799be25321552402a49303bb06a43fe4) docs: Update README (GitHub Actions Bot) - [`acf03d4`](https://redirect.github.com/eslint/eslint/commit/acf03d4eed31d259c7dc62af5b9640629784f7cc) docs: clarify precedence of parserOptions over languageOptions ([#​20926](https://redirect.github.com/eslint/eslint/issues/20926)) (sethamus) #### Chores - [`b18bf58`](https://redirect.github.com/eslint/eslint/commit/b18bf58c5ac748415ffffdff2d96980fbd6a57e8) chore: update ecosystem plugins ([#​20959](https://redirect.github.com/eslint/eslint/issues/20959)) (ESLint Bot) - [`c2d1444`](https://redirect.github.com/eslint/eslint/commit/c2d1444df77cb42e5a0b89ab70496879d180a54d) refactor: replace areAllSegmentsUnreachable with !isAnySegmentReachable ([#​20951](https://redirect.github.com/eslint/eslint/issues/20951)) (Taejin Kim) - [`243b8c5`](https://redirect.github.com/eslint/eslint/commit/243b8c56014bbbe63771185b0731d8dd4d1316e9) chore: enhance config-rule to support oneOf, anyOf, and nested schemas ([#​20788](https://redirect.github.com/eslint/eslint/issues/20788)) (kuldeep kumar) - [`217b2a9`](https://redirect.github.com/eslint/eslint/commit/217b2a91f46137c5ffd693965e71306c4c15ea6b) test: add unit tests for ParserService ([#​20949](https://redirect.github.com/eslint/eslint/issues/20949)) (Taejin Kim) - [`72003e7`](https://redirect.github.com/eslint/eslint/commit/72003e781d76bd4ee0d98a6601730d0b829070f9) test: add location information to error messages in `max-statements` ([#​20945](https://redirect.github.com/eslint/eslint/issues/20945)) (lumir) - [`7797c26`](https://redirect.github.com/eslint/eslint/commit/7797c266977b0bc4971aa79721813d480de72cd1) refactor: deduplicate isAnySegmentReachable across rules ([#​20890](https://redirect.github.com/eslint/eslint/issues/20890)) (Taejin Kim) - [`67c46fa`](https://redirect.github.com/eslint/eslint/commit/67c46fa6e4f34e88cc6bc82f8a0dcc917c65d257) chore: update ecosystem plugins ([#​20938](https://redirect.github.com/eslint/eslint/issues/20938)) (ESLint Bot) - [`95d8c7a`](https://redirect.github.com/eslint/eslint/commit/95d8c7a99f991abd8ab618d0ee2cbd4f58effc29) chore: update dependency [@​eslint/json](https://redirect.github.com/eslint/json) to v2 ([#​20934](https://redirect.github.com/eslint/eslint/issues/20934)) (renovate\[bot]) - [`cf9e496`](https://redirect.github.com/eslint/eslint/commit/cf9e496205142cd4971b9f98aed85866d1010b9c) chore: update [@​arethetypeswrong/cli](https://redirect.github.com/arethetypeswrong/cli) to 0.18.3 ([#​20933](https://redirect.github.com/eslint/eslint/issues/20933)) (Pixel998) - [`fb6d396`](https://redirect.github.com/eslint/eslint/commit/fb6d3960cacc51fc12383fa5ded2382adbf90c1c) test: run type tests with TypeScript 7 ([#​20868](https://redirect.github.com/eslint/eslint/issues/20868)) (sethamus) ### [`v10.4.1`](https://redirect.github.com/eslint/eslint/releases/tag/v10.4.1) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.4.0...v10.4.1) #### Bug Fixes - [`e557467`](https://redirect.github.com/eslint/eslint/commit/e557467db7496220eebcbe2ac5ea6d38c12bb1ec) fix: update `@eslint/plugin-kit` version to 0.7.2 ([#​20930](https://redirect.github.com/eslint/eslint/issues/20930)) (Francesco Trotta) - [`d4ce898`](https://redirect.github.com/eslint/eslint/commit/d4ce898796ca22c3b96aa70d3014cb85f4bac1cd) fix: propagate failures from delegated commands ([#​20917](https://redirect.github.com/eslint/eslint/issues/20917)) (Minh Vu) - [`f4f3507`](https://redirect.github.com/eslint/eslint/commit/f4f3507460bc016b5be979c05d2969793f570cbf) fix: prefer-arrow-callback invalid autofix with newline after `async` ([#​20916](https://redirect.github.com/eslint/eslint/issues/20916)) (kuldeep kumar) - [`c5bc78b`](https://redirect.github.com/eslint/eslint/commit/c5bc78b37e08b9054a11f0cc2d81808bb24acb85) fix: false positive for reference in `finally` block ([#​20655](https://redirect.github.com/eslint/eslint/issues/20655)) (Tanuj Kanti) - [`27538c0`](https://redirect.github.com/eslint/eslint/commit/27538c01f5df4e9306f6f4ba867b2dd6307fae59) fix: add missing CodePath and CodePathSegment types ([#​20853](https://redirect.github.com/eslint/eslint/issues/20853)) (Pixel998) #### Documentation - [`61b0add`](https://redirect.github.com/eslint/eslint/commit/61b0add61ffc52665562be7bb96f526690a78b30) docs: remove deprecated rule from related rules of `max-params` ([#​20921](https://redirect.github.com/eslint/eslint/issues/20921)) (Tanuj Kanti) - [`305d5b9`](https://redirect.github.com/eslint/eslint/commit/305d5b91aeac24d36fde42f75625a8f183d4ce43) docs: remove deprecated rules from related rules section ([#​20911](https://redirect.github.com/eslint/eslint/issues/20911)) (Tanuj Kanti) - [`49b0202`](https://redirect.github.com/eslint/eslint/commit/49b0202d01918b8061720d586dffd7c68047090c) docs: fix `display: none` of ad ([#​20901](https://redirect.github.com/eslint/eslint/issues/20901)) (Tanuj Kanti) - [`9067f94`](https://redirect.github.com/eslint/eslint/commit/9067f9492ec998afc5b4f057a477ecf6ebd45e44) docs: switch build to Node.js 24 ([#​20893](https://redirect.github.com/eslint/eslint/issues/20893)) (Milos Djermanovic) - [`c91b041`](https://redirect.github.com/eslint/eslint/commit/c91b0417e3420c76807ce1fa2aea76e2de87ab86) docs: Update README (GitHub Actions Bot) - [`e349265`](https://redirect.github.com/eslint/eslint/commit/e349265cb37f3ebc837e178e48a725bb782bd870) docs: clarify semver strings in rule deprecation objects ([#​20885](https://redirect.github.com/eslint/eslint/issues/20885)) (Milos Djermanovic) #### Chores - [`b0e466b`](https://redirect.github.com/eslint/eslint/commit/b0e466b6ab47bfc7de43d8de0c315d8ee83aa584) test: add `data` property to invalid tests cases for rules ([#​20924](https://redirect.github.com/eslint/eslint/issues/20924)) (Tanuj Kanti) - [`f78838b`](https://redirect.github.com/eslint/eslint/commit/f78838bc4c86d487e1bcc7cede260c4467721c46) test: add CodePath type coverage ([#​20904](https://redirect.github.com/eslint/eslint/issues/20904)) (Pixel998) - [`1daa4bd`](https://redirect.github.com/eslint/eslint/commit/1daa4bd734b79a62e317d0394394a6b38cff49f9) chore: update `eslint-plugin-eslint-comments` test data to latest commit ([#​20922](https://redirect.github.com/eslint/eslint/issues/20922)) (Francesco Trotta) - [`002942c`](https://redirect.github.com/eslint/eslint/commit/002942ce988ea28b78e0a2f3b074081e638b552c) ci: declare contents:read on update-readme workflow ([#​20919](https://redirect.github.com/eslint/eslint/issues/20919)) (Arpit Jain) - [`64bca24`](https://redirect.github.com/eslint/eslint/commit/64bca24e7bed35bc3c864fc625cb2d89eca87d5b) chore: update ecosystem plugins ([#​20912](https://redirect.github.com/eslint/eslint/issues/20912)) (ESLint Bot) - [`6d7c832`](https://redirect.github.com/eslint/eslint/commit/6d7c832950d5e92499d88e504080661f888f8f56) chore: ignore fflate updates in renovate ([#​20908](https://redirect.github.com/eslint/eslint/issues/20908)) (Pixel998) - [`b2c8638`](https://redirect.github.com/eslint/eslint/commit/b2c86382164d87c6203b78d52068cd6a2a6ffe30) ci: bump pnpm/action-setup from 6.0.7 to 6.0.8 ([#​20889](https://redirect.github.com/eslint/eslint/issues/20889)) (dependabot\[bot]) - [`a9b8d7f`](https://redirect.github.com/eslint/eslint/commit/a9b8d7f74c50211701cfc49710fa541fd91b2aa5) chore: increase maxBuffer for ecosystem tests ([#​20881](https://redirect.github.com/eslint/eslint/issues/20881)) (sethamus) - [`b702ead`](https://redirect.github.com/eslint/eslint/commit/b702ead5e1ed7cb9f28238a454797662efb37396) chore: update ecosystem update PR settings ([#​20884](https://redirect.github.com/eslint/eslint/issues/20884)) (Pixel998) - [`507f60e`](https://redirect.github.com/eslint/eslint/commit/507f60e9a78c9a902bc8759f066ae17a1ea6cd81) chore: update ecosystem plugins ([#​20882](https://redirect.github.com/eslint/eslint/issues/20882)) (ESLint Bot) - [`92f5c5b`](https://redirect.github.com/eslint/eslint/commit/92f5c5bb6bf3a5d167c8ee53a430833410295c6d) test: add unit test for message-count ([#​20878](https://redirect.github.com/eslint/eslint/issues/20878)) (kuldeep kumar) - [`df32108`](https://redirect.github.com/eslint/eslint/commit/df321080af5758b1fa25e4b9a40e26135642dd6e) chore: add [@​eslint/markdown](https://redirect.github.com/eslint/markdown) and typescript-eslint ecosystem tests ([#​20837](https://redirect.github.com/eslint/eslint/issues/20837)) (sethamus) - [`327f91d`](https://redirect.github.com/eslint/eslint/commit/327f91d36aa49f2a50ded931d841a16374fd875f) chore: use includeIgnoreFile internally ([#​20876](https://redirect.github.com/eslint/eslint/issues/20876)) (Kirk Waiblinger) - [`f0dc4bd`](https://redirect.github.com/eslint/eslint/commit/f0dc4bd893fb3a9f44e4ddc3ad7063ffb0beacd3) chore: pin fflate\@​0.8.2 ([#​20877](https://redirect.github.com/eslint/eslint/issues/20877)) (Milos Djermanovic) - [`0f4bd25`](https://redirect.github.com/eslint/eslint/commit/0f4bd257a67a082b756de746d9e0c4842ab764ca) ci: run Discord alert for ecosystem test failures ([#​20873](https://redirect.github.com/eslint/eslint/issues/20873)) (Copilot) ### [`v10.4.0`](https://redirect.github.com/eslint/eslint/releases/tag/v10.4.0) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.3.0...v10.4.0) #### Features - [`1a45ec5`](https://redirect.github.com/eslint/eslint/commit/1a45ec596af1dd5f880e6874cb8f24dafb6a7ecf) feat: check sequence expressions in `for-direction` ([#​20701](https://redirect.github.com/eslint/eslint/issues/20701)) (kuldeep kumar) - [`450040b`](https://redirect.github.com/eslint/eslint/commit/450040bd89b989b3531824c6be45feb5fe3d936b) feat: add `includeIgnoreFile()` to `eslint/config` ([#​20735](https://redirect.github.com/eslint/eslint/issues/20735)) (Kirk Waiblinger) #### Bug Fixes - [`544c0c3`](https://redirect.github.com/eslint/eslint/commit/544c0c3da589166ad8e5d634f35d3d06701c57be) fix: escape code path DOT labels in debug output ([#​20866](https://redirect.github.com/eslint/eslint/issues/20866)) (Pixel998) - [`6799431`](https://redirect.github.com/eslint/eslint/commit/6799431203f2579632d0870f98ba132067f4040c) fix: update dependency [@​eslint/config-helpers](https://redirect.github.com/eslint/config-helpers) to ^0.6.0 ([#​20850](https://redirect.github.com/eslint/eslint/issues/20850)) (renovate\[bot]) - [`f078fef`](https://redirect.github.com/eslint/eslint/commit/f078fef5005dceb14fc162aab7c7200e027688dd) fix: handle non-array deprecated rule replacements ([#​20825](https://redirect.github.com/eslint/eslint/issues/20825)) (xbinaryx) #### Documentation - [`7e52a71`](https://redirect.github.com/eslint/eslint/commit/7e52a7151fb92eec0e0f67fe4e5ddbd1ccce796f) docs: add mention of `@eslint-react/eslint-plugin` ([#​20869](https://redirect.github.com/eslint/eslint/issues/20869)) (Pavel) - [`db3468b`](https://redirect.github.com/eslint/eslint/commit/db3468ba746407d7f286f18f7ea9db6df0e3bc08) docs: tweak wording around ambiguous CJS-vs-ESM config ([#​20865](https://redirect.github.com/eslint/eslint/issues/20865)) (Kirk Waiblinger) - [`9084664`](https://redirect.github.com/eslint/eslint/commit/90846643ec6e97d447ae0d831fabe6d17b0a998a) docs: Update README (GitHub Actions Bot) - [`9cc7387`](https://redirect.github.com/eslint/eslint/commit/9cc73875046e3c4b8313644cbb1e99e26b36bd3f) docs: Update README (GitHub Actions Bot) - [`3d7b548`](https://redirect.github.com/eslint/eslint/commit/3d7b5484407403817aa9071a394d336d8ea96eb5) docs: Update README (GitHub Actions Bot) - [`191ec3c`](https://redirect.github.com/eslint/eslint/commit/191ec3c0a3f94ce0f110df761f0b2b8949011ccb) docs: Update README (GitHub Actions Bot) #### Chores - [`6616856`](https://redirect.github.com/eslint/eslint/commit/6616856f28fa514a30f87b5539fc100d739a94bf) chore: upgrade knip to v6 ([#​20875](https://redirect.github.com/eslint/eslint/issues/20875)) (Pixel998) - [`d13b084`](https://redirect.github.com/eslint/eslint/commit/d13b084a3ad02f926e9addaa35fc383759ea5554) ci: ensure auto-created PRs run CI ([#​20860](https://redirect.github.com/eslint/eslint/issues/20860)) (lumir) - [`e71c7af`](https://redirect.github.com/eslint/eslint/commit/e71c7af86dce9acc1d18cb12d2184309f6841594) ci: bump pnpm/action-setup from 6.0.5 to 6.0.7 ([#​20862](https://redirect.github.com/eslint/eslint/issues/20862)) (dependabot\[bot]) - [`d84393d`](https://redirect.github.com/eslint/eslint/commit/d84393dea170f54191fd20c8268b52c81c0ccd99) test: add unit tests for SuppressionsService.applySuppressions() ([#​20863](https://redirect.github.com/eslint/eslint/issues/20863)) (kuldeep kumar) - [`24db8cb`](https://redirect.github.com/eslint/eslint/commit/24db8cb8e6f07fba667121777a15b1785486be94) test: add tests for SuppressionsService.save() ([#​20802](https://redirect.github.com/eslint/eslint/issues/20802)) (kuldeep kumar) - [`2ef0549`](https://redirect.github.com/eslint/eslint/commit/2ef0549cac4a9537e4c3a26b9f3edd4c99476bf6) chore: update ecosystem plugins ([#​20857](https://redirect.github.com/eslint/eslint/issues/20857)) (github-actions\[bot]) - [`a429791`](https://redirect.github.com/eslint/eslint/commit/a4297918d264d229a06cd96051ef9b91c7b86732) ci: remove `eslint-webpack-plugin` types integration test ([#​20668](https://redirect.github.com/eslint/eslint/issues/20668)) (Milos Djermanovic) - [`9e37386`](https://redirect.github.com/eslint/eslint/commit/9e37386aa7f2ce220b2ef74a6afbac5f6b3527c5) chore: replace `recast` with range approach in code-sample-minimizer ([#​20682](https://redirect.github.com/eslint/eslint/issues/20682)) (Copilot) - [`0dd1f9f`](https://redirect.github.com/eslint/eslint/commit/0dd1f9ffc9a07704d46e2a4c8d4ccc0d0908b0c0) test: disable warning for `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER` ([#​20845](https://redirect.github.com/eslint/eslint/issues/20845)) (Francesco Trotta) - [`9da3c7b`](https://redirect.github.com/eslint/eslint/commit/9da3c7bc92d9579f8db19ecb56e718538d09db2b) refactor: remove deprecated `meta.language` and migrate `meta.dialects` ([#​20716](https://redirect.github.com/eslint/eslint/issues/20716)) (Pixel998) - [`2099ed1`](https://redirect.github.com/eslint/eslint/commit/2099ed12a0a74c3d7f0808514362af2499b4fe2b) refactor: add `meta.defaultOptions` to more rules, enable linting ([#​20800](https://redirect.github.com/eslint/eslint/issues/20800)) (xbinaryx) - [`f1dfbc9`](https://redirect.github.com/eslint/eslint/commit/f1dfbc9ca57196de7092e1888cc99427bd6fe06e) chore: update ecosystem plugins ([#​20836](https://redirect.github.com/eslint/eslint/issues/20836)) (github-actions\[bot]) - [`c759413`](https://redirect.github.com/eslint/eslint/commit/c75941390c14728806cd4baef4f6072f6de78318) ci: bump pnpm/action-setup from 6.0.3 to 6.0.5 ([#​20843](https://redirect.github.com/eslint/eslint/issues/20843)) (dependabot\[bot]) - [`5b817d6`](https://redirect.github.com/eslint/eslint/commit/5b817d6fdc9ae2c35b528dc662b2eca8f40f64aa) test: add unit tests for lib/shared/ast-utils ([#​20838](https://redirect.github.com/eslint/eslint/issues/20838)) (kuldeep kumar) - [`1c13ae3`](https://redirect.github.com/eslint/eslint/commit/1c13ae3934c198c494e5958fa3a68b33244ff06a) test: add unit tests for lib/shared/severity ([#​20835](https://redirect.github.com/eslint/eslint/issues/20835)) (kuldeep kumar) ### [`v10.3.0`](https://redirect.github.com/eslint/eslint/releases/tag/v10.3.0) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.2.1...v10.3.0) #### Features - [`379571a`](https://redirect.github.com/eslint/eslint/commit/379571a975f2b24d88037b9de2e72ec61d004130) feat: add suggestions for no-unused-private-class-members ([#​20773](https://redirect.github.com/eslint/eslint/issues/20773)) (sethamus) #### Bug Fixes - [`b6ae5cf`](https://redirect.github.com/eslint/eslint/commit/b6ae5cf07b9b51802367539cb24b245b61eaa37c) fix: handle unavailable require cache ([#​20812](https://redirect.github.com/eslint/eslint/issues/20812)) (Simon Podlipsky) - [`6fb3685`](https://redirect.github.com/eslint/eslint/commit/6fb3685bcbe9a6f72fd7dfb9129686b6fb96b0bd) fix: rule suggestions cause continuation in class body ([#​20787](https://redirect.github.com/eslint/eslint/issues/20787)) (Milos Djermanovic) #### Documentation - [`32cc7ab`](https://redirect.github.com/eslint/eslint/commit/32cc7ab4ec653ce89da92deb5c40a9f4fc707fe5) docs: fix typos in docs and comments ([#​20809](https://redirect.github.com/eslint/eslint/issues/20809)) (Tanuj Kanti) - [`7f47937`](https://redirect.github.com/eslint/eslint/commit/7f479376a2fa463d823ab762db6bb37ce8d2ee8f) docs: Update README (GitHub Actions Bot) #### Chores - [`d32235e`](https://redirect.github.com/eslint/eslint/commit/d32235ec19ceea211fa86452afa383ca05f5c2f9) ci: use pnpm in `eslint-flat-config-utils` type integration test ([#​20826](https://redirect.github.com/eslint/eslint/issues/20826)) (Francesco Trotta) - [`3ffb14e`](https://redirect.github.com/eslint/eslint/commit/3ffb14ea517de750ed1181579ef844af342e4096) chore: clean up typos in comments and JSDoc ([#​20821](https://redirect.github.com/eslint/eslint/issues/20821)) (Pixel998) - [`22eb58a`](https://redirect.github.com/eslint/eslint/commit/22eb58a21cbde2fbd53a1fae99453d408672de50) chore: add missing continue-on-error to ecosystem-tests.yml ([#​20818](https://redirect.github.com/eslint/eslint/issues/20818)) (Josh Goldberg ✨) - [`88bf002`](https://redirect.github.com/eslint/eslint/commit/88bf0024cb36caebf2880516d9a1f81aa75dafe2) ci: bump pnpm/action-setup from 6.0.1 to 6.0.3 ([#​20815](https://redirect.github.com/eslint/eslint/issues/20815)) (dependabot\[bot]) - [`97c8c33`](https://redirect.github.com/eslint/eslint/commit/97c8c330beae9557ad24e19f94eebc8d08d1a722) chore: update ilshidur/action-discord action to v0.4.0 ([#​20811](https://redirect.github.com/eslint/eslint/issues/20811)) (renovate\[bot]) - [`2f58136`](https://redirect.github.com/eslint/eslint/commit/2f58136dd47364a4cae7054a64f7bf1e79693813) chore: pin peter-evans/create-pull-request action to [`5f6978f`](https://redirect.github.com/eslint/eslint/commit/5f6978f) ([#​20810](https://redirect.github.com/eslint/eslint/issues/20810)) (renovate\[bot]) - [`77add7f`](https://redirect.github.com/eslint/eslint/commit/77add7f1bc91ed17bba3be3289928a9146c5f5a1) chore: add initial ecosystem plugin tests workflow ([#​19643](https://redirect.github.com/eslint/eslint/issues/19643)) (Josh Goldberg ✨) - [`4023b55`](https://redirect.github.com/eslint/eslint/commit/4023b55490fae55e464fe35530ef038cdf5d79a5) test: Add unit tests for SuppressionsService.prune() ([#​20797](https://redirect.github.com/eslint/eslint/issues/20797)) (kuldeep kumar) - [`54080da`](https://redirect.github.com/eslint/eslint/commit/54080dad4f77bb39a1a843933d4ff3a2b7c175e2) test: add unit tests for ForkContext ([#​20778](https://redirect.github.com/eslint/eslint/issues/20778)) (kuldeep kumar) - [`f0e2bcc`](https://redirect.github.com/eslint/eslint/commit/f0e2bcc4bf19253aaebfbd7df87824b0ca4a151f) test: add unit tests for SuppressionsService.suppress() method ([#​20765](https://redirect.github.com/eslint/eslint/issues/20765)) (kuldeep kumar) - [`a7f0b94`](https://redirect.github.com/eslint/eslint/commit/a7f0b94743a99bcdf8d07cff15ffbfa6a6c5f927) chore: update dependency prettier to v3.8.3 ([#​20782](https://redirect.github.com/eslint/eslint/issues/20782)) (renovate\[bot]) - [`7bf93d9`](https://redirect.github.com/eslint/eslint/commit/7bf93d9e79f6dbf77242cbb9a9b8be834730fccd) chore: update TypeScript to v6 ([#​20677](https://redirect.github.com/eslint/eslint/issues/20677)) (sethamus) - [`b42dd72`](https://redirect.github.com/eslint/eslint/commit/b42dd72e76e7f90e7f0be9458288d93353052adc) ci: bump pnpm/action-setup from 6.0.0 to 6.0.1 ([#​20781](https://redirect.github.com/eslint/eslint/issues/20781)) (dependabot\[bot]) - [`2b252be`](https://redirect.github.com/eslint/eslint/commit/2b252be80f362cca7be3326a6dbe958680fdfe9a) test: add unit tests for IdGenerator ([#​20775](https://redirect.github.com/eslint/eslint/issues/20775)) (kuldeep kumar) ### [`v10.2.1`](https://redirect.github.com/eslint/eslint/releases/tag/v10.2.1) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.2.0...v10.2.1) #### Bug Fixes - [`14be92b`](https://redirect.github.com/eslint/eslint/commit/14be92b6d1fa0923b8923830f2208e5e2705b002) fix: model generator yield resumption paths in code path analysis ([#​20665](https://redirect.github.com/eslint/eslint/issues/20665)) (sethamus) - [`84a19d2`](https://redirect.github.com/eslint/eslint/commit/84a19d2c32255db6b9cfc08644a607aae6d5cb62) fix: no-async-promise-executor false positives for shadowed Promise ([#​20740](https://redirect.github.com/eslint/eslint/issues/20740)) (xbinaryx) - [`af764af`](https://redirect.github.com/eslint/eslint/commit/af764af0ec38225755fbf8a6f207f0c77b595a8d) fix: clarify language and processor validation errors ([#​20729](https://redirect.github.com/eslint/eslint/issues/20729)) (Pixel998) - [`e251b89`](https://redirect.github.com/eslint/eslint/commit/e251b89a38280973e468a4a9386c138f4f55d10d) fix: update eslint ([#​20715](https://redirect.github.com/eslint/eslint/issues/20715)) (renovate\[bot]) #### Documentation - [`ca92ca0`](https://redirect.github.com/eslint/eslint/commit/ca92ca0fb4599e8de1e2fb914e695fe7397cbe63) docs: reuse markdown-it instance for markdown filter ([#​20768](https://redirect.github.com/eslint/eslint/issues/20768)) (Amaresh S M) - [`57d2ee2`](https://redirect.github.com/eslint/eslint/commit/57d2ee213305cee0cb55ef08e0480b57396269a9) docs: Enable Eleventy incremental mode for watch ([#​20767](https://redirect.github.com/eslint/eslint/issues/20767)) (Amaresh S M) - [`c1621b9`](https://redirect.github.com/eslint/eslint/commit/c1621b915742276e5f4b25efe790ca62296330dc) docs: fix typos in code-path-analyzer.js ([#​20700](https://redirect.github.com/eslint/eslint/issues/20700)) (Ayush Shukla) - [`1418d52`](https://redirect.github.com/eslint/eslint/commit/1418d522d10bde1960f4942afb548bc7160ec49e) docs: Update README (GitHub Actions Bot) - [`39771e6`](https://redirect.github.com/eslint/eslint/commit/39771e6e600f0b0617fdeafff6dd07e4211ffde6) docs: Update README (GitHub Actions Bot) - [`71e0469`](https://redirect.github.com/eslint/eslint/commit/71e04693def2df57268f08f3072a2749df6bf438) docs: fix incomplete JSDoc param description in no-shadow rule ([#​20728](https://redirect.github.com/eslint/eslint/issues/20728)) (kuldeep kumar) - [`22119ce`](https://redirect.github.com/eslint/eslint/commit/22119ceb93e28f62262fc1d98ff1b1442d6e2dbf) docs: clarify scope of for-direction rule with dead code examples ([#​20723](https://redirect.github.com/eslint/eslint/issues/20723)) (Amaresh S M) - [`8f3fb77`](https://redirect.github.com/eslint/eslint/commit/8f3fb77f122a5641d1833cad5d93f3f54fa3be0b) docs: document `meta.docs.dialects` ([#​20718](https://redirect.github.com/eslint/eslint/issues/20718)) (Pixel998) #### Chores - [`7ddfea9`](https://redirect.github.com/eslint/eslint/commit/7ddfea9c4f62add1588c5c0b0da568c299246383) chore: update dependency prettier to v3.8.2 ([#​20770](https://redirect.github.com/eslint/eslint/issues/20770)) (renovate\[bot]) - [`fac40e1`](https://redirect.github.com/eslint/eslint/commit/fac40e1de2ba7646cc7cd2d3f93fbdd1f8819001) ci: bump pnpm/action-setup from 5.0.0 to 6.0.0 ([#​20763](https://redirect.github.com/eslint/eslint/issues/20763)) (dependabot\[bot]) - [`7246f92`](https://redirect.github.com/eslint/eslint/commit/7246f923332522d8b3d46b6ee646fce88535f3fb) test: add tests for SuppressionsService.load() error handling ([#​20734](https://redirect.github.com/eslint/eslint/issues/20734)) (kuldeep kumar) - [`4f34b1e`](https://redirect.github.com/eslint/eslint/commit/4f34b1e592b0f63d766d9903998e8e36eb49d3aa) chore: update pnpm/action-setup action to v5 ([#​20762](https://redirect.github.com/eslint/eslint/issues/20762)) (renovate\[bot]) - [`51080eb`](https://redirect.github.com/eslint/eslint/commit/51080eb5c98d619434e4835dbe9f1c6654aca3b8) test: processor service ([#​20731](https://redirect.github.com/eslint/eslint/issues/20731)) (kuldeep kumar) - [`e7e1889`](https://redirect.github.com/eslint/eslint/commit/e7e1889fca9b6044e08f41b38df20a1ce45808c8) chore: remove stale babel-eslint10 fixture and test ([#​20727](https://redirect.github.com/eslint/eslint/issues/20727)) (kuldeep kumar) - [`4e1a87c`](https://redirect.github.com/eslint/eslint/commit/4e1a87cb8fb90e309524bc36bc5f31b9f9cfaa76) test: remove redundant async/await in flat config array tests ([#​20722](https://redirect.github.com/eslint/eslint/issues/20722)) (Pixel998) - [`066eabb`](https://redirect.github.com/eslint/eslint/commit/066eabb3643b12931f991594969bcc0028f71a5f) test: add rule metadata coverage for `languages` and `docs.dialects` ([#​20717](https://redirect.github.com/eslint/eslint/issues/20717)) (Pixel998) ### [`v10.2.0`](https://redirect.github.com/eslint/eslint/releases/tag/v10.2.0) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.1.0...v10.2.0) #### Features - [`586ec2f`](https://redirect.github.com/eslint/eslint/commit/586ec2f43092779acc957866db4abe999112d1e1) feat: Add `meta.languages` support to rules ([#​20571](https://redirect.github.com/eslint/eslint/issues/20571)) (Copilot) - [`14207de`](https://redirect.github.com/eslint/eslint/commit/14207dee3939dc87cfa8b2fcfc271fff2cfd6471) feat: add `Temporal` to `no-obj-calls` ([#​20675](https://redirect.github.com/eslint/eslint/issues/20675)) (Pixel998) - [`bbb2c93`](https://redirect.github.com/eslint/eslint/commit/bbb2c93a2b31bd30924f32fe69a9acf41f9dfe35) feat: add Temporal to ES2026 globals ([#​20672](https://redirect.github.com/eslint/eslint/issues/20672)) (Pixel998) #### Bug Fixes - [`542cb3e`](https://redirect.github.com/eslint/eslint/commit/542cb3e6442a4e6ee3457c799e2a0ee23bef0c6a) fix: update first-party dependencies ([#​20714](https://redirect.github.com/eslint/eslint/issues/20714)) (Francesco Trotta) #### Documentation - [`a2af743`](https://redirect.github.com/eslint/eslint/commit/a2af743ea60f683d0e0de9d98267c1e7e4f5e412) docs: add `language` to configuration objects ([#​20712](https://redirect.github.com/eslint/eslint/issues/20712)) (Francesco Trotta) - [`845f23f`](https://redirect.github.com/eslint/eslint/commit/845f23f1370892bf07d819497ac518c9e65090d6) docs: Update README (GitHub Actions Bot) - [`5fbcf59`](https://redirect.github.com/eslint/eslint/commit/5fbcf5958b897cc4df5d652924d18428db37f7ee) docs: remove `sourceType` from ts playground link ([#​20477](https://redirect.github.com/eslint/eslint/issues/20477)) (Tanuj Kanti) - [`8702a47`](https://redirect.github.com/eslint/eslint/commit/8702a474659be786b6b1392e5e7c0c56355ae4a4) docs: Update README (GitHub Actions Bot) - [`ddeaded`](https://redirect.github.com/eslint/eslint/commit/ddeaded2ab36951383ff67c60fb64ec68d29a46a) docs: Update README (GitHub Actions Bot) - [`2b44966`](https://redirect.github.com/eslint/eslint/commit/2b4496691266547784a7f7ad1989ce53381bab91) docs: add Major Releases section to Manage Releases ([#​20269](https://redirect.github.com/eslint/eslint/issues/20269)) (Milos Djermanovic) - [`eab65c7`](https://redirect.github.com/eslint/eslint/commit/eab65c700ebb16a6e790910c720450c9908961fd) docs: update `eslint` versions in examples ([#​20664](https://redirect.github.com/eslint/eslint/issues/20664)) (루밀LuMir) - [`3e4a299`](https://redirect.github.com/eslint/eslint/commit/3e4a29903bf31f0998e45ad9128a265bce1edc56) docs: update ESM Dependencies policies with note for own-usage packages ([#​20660](https://redirect.github.com/eslint/eslint/issues/20660)) (Milos Djermanovic) #### Chores - [`8120e30`](https://redirect.github.com/eslint/eslint/commit/8120e30f833474f47acc061d24d164e9f022264f) refactor: extract no unmodified loop condition ([#​20679](https://redirect.github.com/eslint/eslint/issues/20679)) (kuldeep kumar) - [`46e8469`](https://redirect.github.com/eslint/eslint/commit/46e8469786be1b2bbb522100e1d44624d98d3745) chore: update dependency markdownlint-cli2 to ^0.22.0 ([#​20697](https://redirect.github.com/eslint/eslint/issues/20697)) (renovate\[bot]) - [`01ed3aa`](https://redirect.github.com/eslint/eslint/commit/01ed3aa68477f81a7188e1498cf4906e02015b7c) test: add unit tests for unicode utilities ([#​20622](https://redirect.github.com/eslint/eslint/issues/20622)) (Manish chaudhary) - [`811f493`](https://redirect.github.com/eslint/eslint/commit/811f4930f82ee2b6ac8eae75cade9bed63de0781) ci: remove `--legacy-peer-deps` from types integration tests ([#​20667](https://redirect.github.com/eslint/eslint/issues/20667)) (Milos Djermanovic) - [`6b86fcf`](https://redirect.github.com/eslint/eslint/commit/6b86fcfc5c75d6a3b8a2cf7bcdb3ef60635a9a03) chore: update dependency npm-run-all2 to v8 ([#​20663](https://redirect.github.com/eslint/eslint/issues/20663)) (renovate\[bot]) - [`632c4f8`](https://redirect.github.com/eslint/eslint/commit/632c4f83bf32b77981c7d395cacddd1bb172ee25) chore: add `prettier` update commit to `.git-blame-ignore-revs` ([#​20662](https://redirect.github.com/eslint/eslint/issues/20662)) (루밀LuMir) - [`b0b0f21`](https://redirect.github.com/eslint/eslint/commit/b0b0f21927e03ba092400e3c70d7058f537765c8) chore: update dependency eslint-plugin-regexp to ^3.1.0 ([#​20659](https://redirect.github.com/eslint/eslint/issues/20659)) (Milos Djermanovic) - [`228a2dd`](https://redirect.github.com/eslint/eslint/commit/228a2dd4b272c17f516ee3541f1dd69eca0a8ab0) chore: update dependency eslint-plugin-eslint-plugin to ^7.3.2 ([#​20661](https://redirect.github.com/eslint/eslint/issues/20661)) (Milos Djermanovic) - [`3ab4d7e`](https://redirect.github.com/eslint/eslint/commit/3ab4d7e244df244102de9d0d250b2ff12456a785) test: Add tests for eslintrc-style keys ([#​20645](https://redirect.github.com/eslint/eslint/issues/20645)) (kuldeep kumar) ### [`v10.1.0`](https://redirect.github.com/eslint/eslint/releases/tag/v10.1.0) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.0.3...v10.1.0) #### Features - [`ff4382b`](https://redirect.github.com/eslint/eslint/commit/ff4382be349035acdb170627a2dc92828e134562) feat: apply fix for `no-var` in `TSModuleBlock` ([#​20638](https://redirect.github.com/eslint/eslint/issues/20638)) (Tanuj Kanti) - [`0916995`](https://redirect.github.com/eslint/eslint/commit/0916995b51528872b15ba4fedb24172cf25fcb3f) feat: Implement api support for bulk-suppressions ([#​20565](https://redirect.github.com/eslint/eslint/issues/20565)) (Blake Sager) #### Bug Fixes - [`2b8824e`](https://redirect.github.com/eslint/eslint/commit/2b8824e6be4223980e929a20025602df20d05ea2) fix: Prevent `no-var` autofix when a variable is used before declaration ([#​20464](https://redirect.github.com/eslint/eslint/issues/20464)) (Amaresh S M) - [`e58b4bf`](https://redirect.github.com/eslint/eslint/commit/e58b4bff167e79afd067d1b0ee9360bec2d3393e) fix: update eslint ([#​20597](https://redirect.github.com/eslint/eslint/issues/20597)) (renovate\[bot]) #### Documentation - [`b7b57fe`](https://redirect.github.com/eslint/eslint/commit/b7b57fe9942c572ff651230f1f96cefed787ca52) docs: use correct JSDoc link in require-jsdoc.md ([#​20641](https://redirect.github.com/eslint/eslint/issues/20641)) (mkemna-clb) - [`58e4cfc`](https://redirect.github.com/eslint/eslint/commit/58e4cfc7dbf0fe40c73f09bf0ff94ad944d0ba0e) docs: add deprecation notice partial ([#​20639](https://redirect.github.com/eslint/eslint/issues/20639)) (Milos Djermanovic) - [`7143dbf`](https://redirect.github.com/eslint/eslint/commit/7143dbf99df27c61edf1552da981794e99a0b2f2) docs: update v9 migration guide for `@eslint/js` usage ([#​20540](https://redirect.github.com/eslint/eslint/issues/20540)) (fnx) - [`035fc4f`](https://redirect.github.com/eslint/eslint/commit/035fc4fbe506e3e4524882cf50db37a4e430adf4) docs: note that `globalReturn` applies only with `sourceType: "script"` ([#​20630](https://redirect.github.com/eslint/eslint/issues/20630)) (Milos Djermanovic) - [`e972c88`](https://redirect.github.com/eslint/eslint/commit/e972c88ab7474a74191ee99ac2558b00d0427a8a) docs: merge ESLint option descriptions into type definitions ([#​20608](https://redirect.github.com/eslint/eslint/issues/20608)) (Francesco Trotta) - [`7f10d84`](https://redirect.github.com/eslint/eslint/commit/7f10d8440137f0cfd75f18f4746ba6a1c621b953) docs: Update README (GitHub Actions Bot) - [`aeed007`](https://redirect.github.com/eslint/eslint/commit/aeed0078ca2f73d4744cc522102178d45b5be64e) docs: open playground link in new tab ([#​20602](https://redirect.github.com/eslint/eslint/issues/20602)) (Tanuj Kanti) - [`a0d1a37`](https://redirect.github.com/eslint/eslint/commit/a0d1a3772679d3d74bb860fc65b5b58678acd452) docs: Add AI Usage Policy ([#​20510](https://redirect.github.com/eslint/eslint/issues/20510)) (Nicholas C. Zakas) #### Chores - [`a9f9cce`](https://redirect.github.com/eslint/eslint/commit/a9f9cce82d80b540a0e3549d0e91c16df28740d8) chore: update dependency eslint-plugin-unicorn to ^63.0.0 ([#​20584](https://redirect.github.com/eslint/eslint/issues/20584)) (Milos Djermanovic) - [`1f42bd7`](https://redirect.github.com/eslint/eslint/commit/1f42bd7876ae4192cf7f7f4faf73b4ef3d2563cb) chore: update `prettier` to 3.8.1 ([#​20651](https://redirect.github.com/eslint/eslint/issues/20651)) (루밀LuMir) - [`c0a6f4a`](https://redirect.github.com/eslint/eslint/commit/c0a6f4a2b4169edeca2a81bf7b47783e39ade366) chore: update dependency [@​eslint/json](https://redirect.github.com/eslint/json) to ^1.2.0 ([#​20652](https://redirect.github.com/eslint/eslint/issues/20652)) (renovate\[bot]) - [`cc43f79`](https://redirect.github.com/eslint/eslint/commit/cc43f795c42e5ec2f19bb43b1f6d534ef2e469f3) chore: update dependency c8 to v11 ([#​20650](https://redirect.github.com/eslint/eslint/issues/20650)) (renovate\[bot]) - [`2ce4635`](https://redirect.github.com/eslint/eslint/commit/2ce4635b036ff2665c7009afddf9c0fb2274dceb) chore: update dependency [@​eslint/json](https://redirect.github.com/eslint/json) to v1 ([#​20649](https://redirect.github.com/eslint/eslint/issues/20649)) (renovate\[bot]) - [`f0406ee`](https://redirect.github.com/eslint/eslint/commit/f0406eedcc3dc415babbbf6bbdb5db1eebfd487b) chore: update dependency markdownlint-cli2 to ^0.21.0 ([#​20646](https://redirect.github.com/eslint/eslint/issues/20646)) (renovate\[bot]) - [`dbb4c95`](https://redirect.github.com/eslint/eslint/commit/dbb4c9582a00bac604d5c6ac671bb7111468a846) chore: remove trunk ([#​20478](https://redirect.github.com/eslint/eslint/issues/20478)) (sethamus) - [`c672a2a`](https://redirect.github.com/eslint/eslint/commit/c672a2a70579fddf1c6ce33dfa712d705726e1c9) test: fix CLI test for empty output file ([#​20640](https://redirect.github.com/eslint/eslint/issues/20640)) (kuldeep kumar) - [`c7ada24`](https://redirect.github.com/eslint/eslint/commit/c7ada2455680036bbfc42fcb1511ff28afe3c587) ci: bump pnpm/action-setup from 4.3.0 to 4.4.0 ([#​20636](https://redirect.github.com/eslint/eslint/issues/20636)) (dependabot\[bot]) - [`07c4b8b`](https://redirect.github.com/eslint/eslint/commit/07c4b8b4a9f49145e60a3448dd57853213ed4de3) test: fix `RuleTester` test without test runners ([#​20631](https://redirect.github.com/eslint/eslint/issues/20631)) (Francesco Trotta) - [`079bba7`](https://redirect.github.com/eslint/eslint/commit/079bba7ff17d0a99fdffe32bf991d005ba797fae) test: Add tests for `isValidWithUnicodeFlag` ([#​20601](https://redirect.github.com/eslint/eslint/issues/20601)) (Manish chaudhary) - [`5885ae6`](https://redirect.github.com/eslint/eslint/commit/5885ae66216bcee9310bbf73786b7d7d5774aeaf) ci: unpin Node.js 25.x in CI ([#​20615](https://redirect.github.com/eslint/eslint/issues/20615)) (Copilot) - [`f65e5d3`](https://redirect.github.com/eslint/eslint/commit/f65e5d3c0df65fdb317ad6d23f7ae113c5f4b6d7) chore: update pnpm/action-setup digest to [`b906aff`](https://redirect.github.com/eslint/eslint/commit/b906aff) ([#​20610](https://redirect.github.com/eslint/eslint/issues/20610)) (renovate\[bot]) ### [`v10.0.3`](https://redirect.github.com/eslint/eslint/releases/tag/v10.0.3) [Compare Source](https://redirect.github.com/eslint/eslint/compare/v10.0.2...v10.0.3) #### Bug Fixes - [`e511b58`](https://redirect.github.com/eslint/eslint/commit/e511b58d5ecd63a232b87743614867f4eaadbba4) fix: update eslint ([#​20595](https://redirect.github.com/eslint/eslint/issues/20595)) (renovate\[bot]) - [`f4c9cf9`](https://redirect.github.com/eslint/eslint/commit/f4c9cf9b8dc5642de555a09295933464080d722a) fix: include variable name in `no-useless-assignment` message ([#​20581](https://redirect.github.com/eslint/eslint/issues/20581)) (sethamus) - [`ee9ff31`](https://redirect.github.com/eslint/eslint/commit/ee9ff31cee13712d2be2a6b5c0a4a54449fe9fe1) fix: update dependency minimatch to ^10.2.4 ([#​20562](https://redirect.github.com/eslint/eslint/issues/20562)) (Milos Djermanovic) #### Documentation - [`9fc31b0`](https://redirect.github.com/eslint/eslint/commit/9fc31b03ef05abfc4f0f449b22947029d51a72f6) docs: Update README (GitHub Actions Bot) - [`4efaa36`](https://redirect.github.com/eslint/eslint/commit/4efaa367c62d5a45dd21e246e4a506e11dd51758) docs: add info box for `eslint-plugin-eslint-comments` ([#​20570](https://redirect.github.com/eslint/eslint/issues/20570)) (DesselBane) - [`23b2759`](https://redirect.github.com/eslint/eslint/commit/23b2759dd5cd70976ab2e8f4a1cf86ffe4b9f65d) docs: add v10 migration guide link to Use docs index ([#​20577](https://redirect.gith > ✂ **Note** > > PR body was truncated to here. </details> --- ### Configuration 📅 **Schedule**: (in timezone Asia/Shanghai) - Branch creation - "before 10am on monday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMzEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIzMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Sysix <sysix@sysix-coding.de> Co-authored-by: Cameron <cameron.clark@hey.com>
586 lines
16 KiB
TypeScript
586 lines
16 KiB
TypeScript
import { spawn } from "node:child_process";
|
|
import fs from "node:fs/promises";
|
|
import { dirname, join } from "node:path";
|
|
import { pathToFileURL } from "node:url";
|
|
import {
|
|
CodeActionRequest,
|
|
createMessageConnection,
|
|
DiagnosticRefreshRequest,
|
|
DiagnosticSeverity,
|
|
DidChangeConfigurationNotification,
|
|
DidChangeTextDocumentNotification,
|
|
DidChangeWatchedFilesParams,
|
|
DidChangeWatchedFilesNotification,
|
|
DidOpenTextDocumentNotification,
|
|
DocumentDiagnosticRequest,
|
|
ExitNotification,
|
|
FileChangeType,
|
|
InitializedNotification,
|
|
InitializeRequest,
|
|
MarkupContent,
|
|
Position,
|
|
RegistrationRequest,
|
|
ShutdownRequest,
|
|
StreamMessageReader,
|
|
StreamMessageWriter,
|
|
WorkspaceFolder,
|
|
} from "vscode-languageserver-protocol/node";
|
|
import {
|
|
ClientCapabilities,
|
|
CodeAction,
|
|
CodeActionContext,
|
|
Command,
|
|
DocumentDiagnosticReport,
|
|
Range,
|
|
Registration,
|
|
} from "vscode-languageserver-protocol/node";
|
|
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
import { codeFrameColumns } from "@babel/code-frame";
|
|
|
|
const CLI_PATH = join(import.meta.dirname, "..", "..", "dist", "cli.js");
|
|
|
|
const PULL_DIAGNOSTICS_CAPABILITY = {
|
|
textDocument: {
|
|
diagnostic: {},
|
|
},
|
|
workspace: {
|
|
diagnostics: {
|
|
refreshSupport: true,
|
|
},
|
|
},
|
|
};
|
|
|
|
export function createLspConnection(env: Record<string, string> = {}) {
|
|
const proc = spawn(process.execPath, [CLI_PATH, "--lsp"], {
|
|
env: {
|
|
...process.env,
|
|
OXC_LOG: "debug",
|
|
...env,
|
|
},
|
|
});
|
|
|
|
const connection = createMessageConnection(
|
|
new StreamMessageReader(proc.stdout),
|
|
new StreamMessageWriter(proc.stdin),
|
|
);
|
|
connection.listen();
|
|
|
|
return {
|
|
// NOTE: Config and ignore files are searched from `workspaceFolders[].uri` upward
|
|
// Or, provide a custom config path via `initializationOptions`
|
|
async initialize(
|
|
workspaceFolders: WorkspaceFolder[] | null,
|
|
capabilities: ClientCapabilities = {},
|
|
initializationOptions?: unknown,
|
|
) {
|
|
const result = await connection.sendRequest(InitializeRequest.type, {
|
|
processId: process.pid,
|
|
capabilities,
|
|
workspaceFolders,
|
|
rootUri: null,
|
|
initializationOptions,
|
|
});
|
|
await connection.sendNotification(InitializedNotification.type, {});
|
|
return result;
|
|
},
|
|
|
|
async didChangeConfiguration(settings: unknown) {
|
|
await connection.sendNotification(DidChangeConfigurationNotification.type, { settings });
|
|
},
|
|
|
|
async didChangeWatchedFiles(uris: string[]) {
|
|
const params: DidChangeWatchedFilesParams = {
|
|
changes: uris.map((uri) => ({ uri, type: FileChangeType.Changed })),
|
|
};
|
|
await connection.sendNotification(DidChangeWatchedFilesNotification.type, params);
|
|
},
|
|
|
|
async didOpen(uri: string, languageId: string, text: string) {
|
|
await connection.sendNotification(DidOpenTextDocumentNotification.type, {
|
|
textDocument: { uri, languageId, version: 1, text },
|
|
});
|
|
},
|
|
|
|
async didChange(uri: string, text: string) {
|
|
await connection.sendNotification(DidChangeTextDocumentNotification.type, {
|
|
textDocument: { uri, version: 2 },
|
|
contentChanges: [{ text }],
|
|
});
|
|
},
|
|
|
|
async diagnostic(uri: string): Promise<DocumentDiagnosticReport> {
|
|
const result = await connection.sendRequest(DocumentDiagnosticRequest.type, {
|
|
textDocument: { uri },
|
|
});
|
|
return result;
|
|
},
|
|
|
|
async codeAction(
|
|
uri: string,
|
|
range: Range,
|
|
context?: CodeActionContext,
|
|
): Promise<(Command | CodeAction)[] | null> {
|
|
const result = await connection.sendRequest(CodeActionRequest.type, {
|
|
textDocument: { uri },
|
|
range,
|
|
context: context ?? { diagnostics: [] },
|
|
});
|
|
return result;
|
|
},
|
|
|
|
async getDynamicRegistration(): Promise<Registration[]> {
|
|
return await new Promise((resolve) => {
|
|
const disposer = connection.onRequest(RegistrationRequest.type, (params) => {
|
|
resolve(params.registrations);
|
|
disposer.dispose();
|
|
});
|
|
});
|
|
},
|
|
|
|
getWorkspaceRefresh(): Promise<void> {
|
|
return new Promise((resolve) => {
|
|
const disposer = connection.onRequest(DiagnosticRefreshRequest.type, () => {
|
|
resolve();
|
|
disposer.dispose();
|
|
});
|
|
});
|
|
},
|
|
|
|
async [Symbol.asyncDispose]() {
|
|
await connection.sendRequest(ShutdownRequest.type);
|
|
await connection.sendNotification(ExitNotification.type);
|
|
connection.dispose();
|
|
proc.kill();
|
|
},
|
|
};
|
|
}
|
|
|
|
// ---
|
|
|
|
export async function lintFixture(
|
|
fixturesDir: string,
|
|
fixturePath: string,
|
|
languageId: string,
|
|
initializationOptions?: OxlintLSPConfig,
|
|
): Promise<string> {
|
|
return lintMultiWorkspaceFixture(
|
|
fixturesDir,
|
|
[{ path: fixturePath, languageId }],
|
|
initializationOptions ? [initializationOptions] : undefined,
|
|
);
|
|
}
|
|
|
|
export async function lintSingleFileFixture(
|
|
fixtureDir: string,
|
|
fixturePath: string,
|
|
languageId: string,
|
|
): Promise<string> {
|
|
await using client = createLspConnection();
|
|
await client.initialize(null, PULL_DIAGNOSTICS_CAPABILITY);
|
|
return await getDiagnosticSnapshot(
|
|
fixturePath,
|
|
join(fixtureDir, fixturePath),
|
|
languageId,
|
|
client,
|
|
);
|
|
}
|
|
export async function lintMultiFileFixture(
|
|
fixturesDir: string,
|
|
fixturePaths: {
|
|
path: string;
|
|
languageId: string;
|
|
}[],
|
|
): Promise<string> {
|
|
const workspaceUri = pathToFileURL(dirname(join(fixturesDir, fixturePaths[0].path))).href;
|
|
await using client = createLspConnection();
|
|
await client.initialize(
|
|
[{ uri: workspaceUri, name: "workspace-0" }],
|
|
PULL_DIAGNOSTICS_CAPABILITY,
|
|
);
|
|
const snapshots = [];
|
|
for (const fixturePath of fixturePaths) {
|
|
snapshots.push(
|
|
// oxlint-disable-next-line no-await-in-loop -- for snapshot consistency
|
|
await getDiagnosticSnapshot(
|
|
fixturePath.path,
|
|
join(fixturesDir, fixturePath.path),
|
|
fixturePath.languageId,
|
|
client,
|
|
),
|
|
);
|
|
}
|
|
return snapshots.join("\n\n");
|
|
}
|
|
|
|
export async function lintMultiWorkspaceFixture(
|
|
fixturesDir: string,
|
|
fixturePaths: {
|
|
path: string;
|
|
languageId: string;
|
|
}[],
|
|
initializationOptions?: OxlintLSPConfig[],
|
|
): Promise<string> {
|
|
const workspaceUris = fixturePaths.map(
|
|
({ path }) => pathToFileURL(dirname(join(fixturesDir, path))).href,
|
|
);
|
|
await using client = createLspConnection();
|
|
|
|
await client.initialize(
|
|
workspaceUris.map((uri, index) => ({ uri, name: `workspace-${index}` })),
|
|
PULL_DIAGNOSTICS_CAPABILITY,
|
|
workspaceUris.map((workspaceUri, index) => ({
|
|
workspaceUri,
|
|
options: initializationOptions?.[index] ?? null,
|
|
})),
|
|
);
|
|
|
|
const snapshots = [];
|
|
for (const fixturePath of fixturePaths) {
|
|
snapshots.push(
|
|
// oxlint-disable-next-line no-await-in-loop -- for snapshot consistency
|
|
await getDiagnosticSnapshot(
|
|
fixturePath.path,
|
|
join(fixturesDir, fixturePath.path),
|
|
fixturePath.languageId,
|
|
client,
|
|
),
|
|
);
|
|
}
|
|
|
|
return snapshots.join("\n\n");
|
|
}
|
|
|
|
export async function lintFixtureWithFileContentChange(
|
|
fixturesDir: string,
|
|
fixturePath: string,
|
|
languageId: string,
|
|
oldConfigPath: string,
|
|
newConfigPath: string,
|
|
initializationOptions?: OxlintLSPConfig,
|
|
): Promise<string> {
|
|
return lintMultiWorkspaceFixtureWithFileContentChange(
|
|
fixturesDir,
|
|
[{ path: fixturePath, languageId }],
|
|
oldConfigPath,
|
|
newConfigPath,
|
|
initializationOptions ? [initializationOptions] : undefined,
|
|
);
|
|
}
|
|
|
|
export async function lintMultiWorkspaceFixtureWithFileContentChange(
|
|
fixturesDir: string,
|
|
fixturePaths: {
|
|
path: string;
|
|
languageId: string;
|
|
}[],
|
|
oldConfigPath: string,
|
|
newConfigPath: string,
|
|
initializationOptions?: OxlintLSPConfig[],
|
|
): Promise<string> {
|
|
const workspaceUris = fixturePaths.map(
|
|
({ path }) => pathToFileURL(dirname(join(fixturesDir, path))).href,
|
|
);
|
|
await using client = createLspConnection();
|
|
|
|
// in theory we should support dynamic registration for the watcher
|
|
// but the server does not care if you request `workspace/didChangeWatchedFiles` without the capability.
|
|
// Avoid the complexity of dynamic registration in tests. This should be done in a separate test if needed.
|
|
await client.initialize(
|
|
workspaceUris.map((uri, index) => ({ uri, name: `workspace-${index}` })),
|
|
PULL_DIAGNOSTICS_CAPABILITY,
|
|
workspaceUris.map((workspaceUri, index) => ({
|
|
workspaceUri,
|
|
options: initializationOptions?.[index] ?? null,
|
|
})),
|
|
);
|
|
|
|
const snapshots = [];
|
|
snapshots.push("=== Before Config Change ===");
|
|
for (const fixturePath of fixturePaths) {
|
|
snapshots.push(
|
|
// oxlint-disable-next-line no-await-in-loop -- for snapshot consistency
|
|
await getDiagnosticSnapshot(
|
|
fixturePath.path,
|
|
join(fixturesDir, fixturePath.path),
|
|
fixturePath.languageId,
|
|
client,
|
|
),
|
|
);
|
|
}
|
|
|
|
const oldContent = await Promise.all(
|
|
fixturePaths.map(({ path }) => {
|
|
const dir = dirname(join(fixturesDir, path));
|
|
const oldFilePath = join(dir, oldConfigPath);
|
|
return fs.readFile(oldFilePath, "utf-8");
|
|
}),
|
|
);
|
|
|
|
try {
|
|
const refreshedUris = await Promise.all(
|
|
fixturePaths.map(async ({ path }) => {
|
|
const dir = dirname(join(fixturesDir, path));
|
|
const filePath = join(dir, newConfigPath);
|
|
const oldFilePath = join(dir, oldConfigPath);
|
|
const newContent = await fs.readFile(filePath, "utf-8");
|
|
await fs.writeFile(oldFilePath, newContent);
|
|
|
|
return pathToFileURL(oldFilePath).href;
|
|
}),
|
|
);
|
|
|
|
const workspaceRefreshPromise = client.getWorkspaceRefresh();
|
|
await client.didChangeWatchedFiles(refreshedUris);
|
|
// Wait for the server to process the file change and ask for refreshed diagnostics
|
|
await workspaceRefreshPromise;
|
|
|
|
// restore old config content to avoid affecting other tests
|
|
|
|
snapshots.push("=== After Config Change ===");
|
|
} finally {
|
|
await Promise.all(
|
|
fixturePaths.map(({ path }, index) => {
|
|
const dir = dirname(join(fixturesDir, path));
|
|
const oldFilePath = join(dir, oldConfigPath);
|
|
return fs.writeFile(oldFilePath, oldContent[index]);
|
|
}),
|
|
);
|
|
}
|
|
|
|
for (const fixturePath of fixturePaths) {
|
|
snapshots.push(
|
|
// oxlint-disable-next-line no-await-in-loop -- for snapshot consistency
|
|
await getDiagnosticSnapshot(
|
|
fixturePath.path,
|
|
join(fixturesDir, fixturePath.path),
|
|
fixturePath.languageId,
|
|
client,
|
|
),
|
|
);
|
|
}
|
|
|
|
return snapshots.join("\n\n");
|
|
}
|
|
|
|
export async function fixFixture(
|
|
fixturesDir: string,
|
|
fixturePath: string,
|
|
languageId: string,
|
|
initializationOptions?: OxlintLSPConfig,
|
|
context?: CodeActionContext,
|
|
): Promise<string> {
|
|
return fixMultiWorkspaceFixture(
|
|
fixturesDir,
|
|
[{ path: fixturePath, languageId }],
|
|
initializationOptions ? [initializationOptions] : undefined,
|
|
context,
|
|
);
|
|
}
|
|
|
|
export async function fixMultiWorkspaceFixture(
|
|
fixturesDir: string,
|
|
fixturePaths: {
|
|
path: string;
|
|
languageId: string;
|
|
}[],
|
|
initializationOptions?: OxlintLSPConfig[],
|
|
context?: CodeActionContext,
|
|
): Promise<string> {
|
|
const workspaceUris = fixturePaths.map(
|
|
({ path }) => pathToFileURL(dirname(join(fixturesDir, path))).href,
|
|
);
|
|
await using client = createLspConnection();
|
|
|
|
await client.initialize(
|
|
workspaceUris.map((uri, index) => ({ uri, name: `workspace-${index}` })),
|
|
PULL_DIAGNOSTICS_CAPABILITY,
|
|
workspaceUris.map((workspaceUri, index) => ({
|
|
workspaceUri,
|
|
options: initializationOptions?.[index] ?? null,
|
|
})),
|
|
);
|
|
|
|
const snapshots = [];
|
|
for (const fixturePath of fixturePaths) {
|
|
snapshots.push(
|
|
// oxlint-disable-next-line no-await-in-loop -- for snapshot consistency
|
|
await getCodeActionSnapshot(
|
|
fixturePath.path,
|
|
join(fixturesDir, fixturePath.path),
|
|
fixturePath.languageId,
|
|
client,
|
|
context,
|
|
),
|
|
);
|
|
}
|
|
|
|
return snapshots.join("\n\n");
|
|
}
|
|
// ---
|
|
|
|
type OxlintLSPConfig = {
|
|
fixKind?: string;
|
|
configPath?: string;
|
|
typeAware?: boolean;
|
|
rulesCustomization?: Record<
|
|
string,
|
|
{
|
|
autofix?: boolean;
|
|
}
|
|
>;
|
|
};
|
|
|
|
async function getDiagnosticSnapshot(
|
|
fixturePath: string,
|
|
filePath: string,
|
|
languageId: string,
|
|
client: ReturnType<typeof createLspConnection>,
|
|
): Promise<string> {
|
|
const fileUri = pathToFileURL(filePath).href;
|
|
const content = await fs.readFile(filePath, "utf-8");
|
|
|
|
await client.didOpen(fileUri, languageId, content);
|
|
|
|
const diagnostics = await client.diagnostic(fileUri);
|
|
|
|
return `
|
|
--- FILE -----------
|
|
${fixturePath}
|
|
--- Diagnostics ---------
|
|
${snapshotDiagnostics(content, diagnostics).join("\n--------------------")}
|
|
--------------------
|
|
`.trim();
|
|
}
|
|
|
|
async function getCodeActionSnapshot(
|
|
fixturePath: string,
|
|
filePath: string,
|
|
languageId: string,
|
|
client: ReturnType<typeof createLspConnection>,
|
|
context?: CodeActionContext,
|
|
): Promise<string> {
|
|
const fileUri = pathToFileURL(filePath).href;
|
|
const content = await fs.readFile(filePath, "utf-8");
|
|
|
|
await client.didOpen(fileUri, languageId, content);
|
|
|
|
const diagnostics = await client.diagnostic(fileUri);
|
|
if (diagnostics.kind !== "full") {
|
|
throw new Error("Only full reports are supported by oxlint lsp");
|
|
}
|
|
|
|
const codeActions = [];
|
|
for (const diagnostic of diagnostics.items) {
|
|
// only for quickfix and default code actions we want a specific range
|
|
// other code actions (like "fix all") should include the document range
|
|
const range =
|
|
!context?.only || context?.only?.includes("quickfix")
|
|
? diagnostic.range
|
|
: // 31 ** 2 - 1 is the max allowed LSP uint value
|
|
Range.create(Position.create(0, 0), Position.create(31 ** 2 - 1, 0));
|
|
|
|
// oxlint-disable-next-line no-await-in-loop -- for snapshot consistency
|
|
const actions = await client.codeAction(fileUri, range, context);
|
|
if (!actions) continue;
|
|
|
|
for (const action of actions) {
|
|
if (!("edit" in action)) {
|
|
throw new Error("Only code actions with edits are supported by oxlint lsp");
|
|
}
|
|
const result = snapshotCodeAction(fileUri, content, languageId, action);
|
|
codeActions.push(result);
|
|
}
|
|
|
|
if (range !== diagnostic.range) {
|
|
// fix all code actions should return the same result, no need to process all diagnostics
|
|
break;
|
|
}
|
|
}
|
|
|
|
return `
|
|
--- FILE -----------
|
|
${fixturePath}
|
|
--- Original Content ---------
|
|
${content}
|
|
--- Code Actions ---------
|
|
${codeActions.join("######\n")}
|
|
--------------------
|
|
`.trim();
|
|
}
|
|
|
|
function getSeverityLabel(severity: number | undefined): string {
|
|
if (!severity) return "Unknown";
|
|
|
|
switch (severity) {
|
|
case DiagnosticSeverity.Error:
|
|
return "Error";
|
|
case DiagnosticSeverity.Warning:
|
|
return "Warning";
|
|
case DiagnosticSeverity.Information:
|
|
return "Information";
|
|
case DiagnosticSeverity.Hint:
|
|
return "Hint";
|
|
default:
|
|
return "Unknown";
|
|
}
|
|
}
|
|
|
|
function lspRangeToBabelLocation(range: Range) {
|
|
return {
|
|
start: {
|
|
line: range.start.line + 1,
|
|
column: range.start.character,
|
|
},
|
|
end: {
|
|
line: range.end.line + 1,
|
|
column: range.end.character,
|
|
},
|
|
};
|
|
}
|
|
|
|
function snapshotDiagnostics(content: string, report: DocumentDiagnosticReport): string[] {
|
|
if (report.kind !== "full") {
|
|
throw new Error("Only full reports are supported by oxlint lsp");
|
|
}
|
|
|
|
return report.items.map((diagnostic) => {
|
|
const babelLocation = lspRangeToBabelLocation(diagnostic.range);
|
|
const severity = getSeverityLabel(diagnostic.severity);
|
|
|
|
return codeFrameColumns(content, babelLocation, {
|
|
message: `${severity}: ${formatDiagnosticMessage(diagnostic.message)}`,
|
|
});
|
|
});
|
|
}
|
|
|
|
function formatDiagnosticMessage(message: string | MarkupContent): string {
|
|
return typeof message === "string" ? message : message.value;
|
|
}
|
|
|
|
function snapshotCodeAction(
|
|
uri: string,
|
|
content: string,
|
|
languageId: string,
|
|
action: CodeAction,
|
|
): string {
|
|
if (!action.edit) {
|
|
throw new Error("Only code actions with edits are supported by oxlint lsp");
|
|
}
|
|
|
|
let result = content;
|
|
for (const [editedUri, textEdits] of Object.entries(action.edit.changes ?? {})) {
|
|
if (editedUri !== uri) {
|
|
throw new Error("Only edits for the same document are supported by oxlint lsp");
|
|
}
|
|
|
|
const doc = TextDocument.create(uri, languageId, 1, content);
|
|
result = TextDocument.applyEdits(doc, textEdits);
|
|
}
|
|
|
|
return `
|
|
Title : ${action.title}
|
|
Preferred: ${action.isPreferred ? "Yes" : "No"}
|
|
Resulting Content:
|
|
${result}`;
|
|
}
|