From 4994f3d290c88ceb7c44b1de4cec868305052fae Mon Sep 17 00:00:00 2001 From: itay mendelawy Date: Tue, 17 Feb 2026 14:17:26 +0000 Subject: [PATCH] fix: migrate plugin import to standalone package --- CHANGELOG.md | 4 + package.json | 5 +- pnpm-lock.yaml | 203 +++++++++++++++++++++++------ src/extraction/variable-tracker.ts | 2 +- src/index.ts | 2 +- src/rules/complexity.ts | 2 +- src/rules/max-cognitive.ts | 2 +- src/rules/shared.ts | 2 +- src/types.ts | 4 +- 9 files changed, 179 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70061d5..c9a57af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Migrate plugin imports from `oxlint/plugins` to standalone `@oxlint/plugins` package (fixes compatibility with oxlint >= 1.45.0) + ### Added - Performance optimization: `minLines` option to skip complexity analysis for small functions. Default: 10 lines. diff --git a/package.json b/package.json index 7aa139b..29de452 100644 --- a/package.json +++ b/package.json @@ -53,14 +53,15 @@ "estree-walker": "^3.0.3", "husky": "^9.1.7", "oxc-parser": "^0.112.0", - "oxlint": "^1.39.0", + "@oxlint/plugins": "^1.48.0", + "oxlint": "^1.48.0", "prettier": "3.8.1", "tsx": "^4.21.0", "typescript": "^5.9.3", "vitest": "^4.0.17" }, "peerDependencies": { - "oxlint": ">=1.0.0" + "@oxlint/plugins": ">=1.43.0" }, "engines": { "node": ">=20.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e13dc7..caf3c7f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: devDependencies: + '@oxlint/plugins': + specifier: ^1.48.0 + version: 1.48.0 '@types/node': specifier: ^22.19.5 version: 22.19.5 @@ -21,8 +24,8 @@ importers: specifier: ^0.112.0 version: 0.112.0 oxlint: - specifier: ^1.39.0 - version: 1.43.0 + specifier: ^1.48.0 + version: 1.48.0 prettier: specifier: 3.8.1 version: 3.8.1 @@ -331,46 +334,124 @@ packages: '@oxc-project/types@0.112.0': resolution: {integrity: sha512-m6RebKHIRsax2iCwVpYW2ErQwa4ywHJrE4sCK3/8JK8ZZAWOKXaRJFl/uP51gaVyyXlaS4+chU1nSCdzYf6QqQ==} - '@oxlint/darwin-arm64@1.43.0': - resolution: {integrity: sha512-C/GhObv/pQZg34NOzB6Mk8x0wc9AKj8fXzJF8ZRKTsBPyHusC6AZ6bba0QG0TUufw1KWuD0j++oebQfWeiFXNw==} + '@oxlint/binding-android-arm-eabi@1.48.0': + resolution: {integrity: sha512-1Pz/stJvveO9ZO7ll4ZoEY3f6j2FiUgBLBcCRCiW6ylId9L9UKs+gn3X28m3eTnoiFCkhKwmJJ+VO6vwsu7Qtg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.48.0': + resolution: {integrity: sha512-Zc42RWGE8huo6Ht0lXKjd0NH2lWNmimQHUmD0JFcvShLOuwN+RSEE/kRakc2/0LIgOUuU/R7PaDMCOdQlPgNUQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.48.0': + resolution: {integrity: sha512-jgZs563/4vaG5jH2RSt2TSh8A2jwsFdmhLXrElMdm3Mmto0HPf85FgInLSNi9HcwzQFvkYV8JofcoUg2GH1HTA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxlint/darwin-x64@1.43.0': - resolution: {integrity: sha512-4NjfUtEEH8ewRQ2KlZGmm6DyrvypMdHwBnQT92vD0dLScNOQzr0V9O8Ua4IWXdeCNl/XMVhAV3h4/3YEYern5A==} + '@oxlint/binding-darwin-x64@1.48.0': + resolution: {integrity: sha512-kvo87BujEUjCJREuWDC4aPh1WoXCRFFWE4C7uF6wuoMw2f6N2hypA/cHHcYn9DdL8R2RrgUZPefC8JExyeIMKA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxlint/linux-arm64-gnu@1.43.0': - resolution: {integrity: sha512-75tf1HvwdZ3ebk83yMbSB+moAEWK98mYqpXiaFAi6Zshie7r+Cx5PLXZFUEqkscenoZ+fcNXakHxfn94V6nf1g==} + '@oxlint/binding-freebsd-x64@1.48.0': + resolution: {integrity: sha512-eyzzPaHQKn0RIM+ueDfgfJF2RU//Wp4oaKs2JVoVYcM5HjbCL36+O0S3wO5Xe1NWpcZIG3cEHc/SuOCDRqZDSg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.48.0': + resolution: {integrity: sha512-p3kSloztK7GRO7FyO3u38UCjZxQTl92VaLDsMQAq0eGoiNmeeEF1KPeE4+Fr+LSkQhF8WvJKSuls6TwOlurdPA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.48.0': + resolution: {integrity: sha512-uWM+wiTqLW/V0ZmY/eyTWs8ykhIkzU+K2tz/8m35YepYEzohiUGRbnkpAFXj2ioXpQL+GUe5vmM3SLH6ozlfFw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.48.0': + resolution: {integrity: sha512-OhQNPjs/OICaYqxYJjKKMaIY7p3nJ9IirXcFoHKD+CQE1BZFCeUUAknMzUeLclDCfudH9Vb/UgjFm8+ZM5puAg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxlint/linux-arm64-musl@1.43.0': - resolution: {integrity: sha512-BHV4fb36T2p/7bpA9fiJ5ayt7oJbiYX10nklW5arYp4l9/9yG/FQC5J4G1evzbJ/YbipF9UH0vYBAm5xbqGrvw==} + '@oxlint/binding-linux-arm64-musl@1.48.0': + resolution: {integrity: sha512-adu5txuwGvQ4C4fjYHJD+vnY+OCwCixBzn7J3KF3iWlVHBBImcosSv+Ye+fbMMJui4HGjifNXzonjKm9pXmOiw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxlint/linux-x64-gnu@1.43.0': - resolution: {integrity: sha512-1l3nvnzWWse1YHibzZ4HQXdF/ibfbKZhp9IguElni3bBqEyPEyurzZ0ikWynDxKGXqZa+UNXTFuU1NRVX1RJ3g==} + '@oxlint/binding-linux-ppc64-gnu@1.48.0': + resolution: {integrity: sha512-inlQQRUnHCny/7b7wA6NjEoJSSZPNea4qnDhWyeqBYWx8ukf2kzNDSiamfhOw6bfAYPm/PVlkVRYaNXQbkLeTQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + + '@oxlint/binding-linux-riscv64-gnu@1.48.0': + resolution: {integrity: sha512-YiJx6sW6bYebQDZRVWLKm/Drswx/hcjIgbLIhULSn0rRcBKc7d9V6mkqPjKDbhcxJgQD5Zi0yVccJiOdF40AWA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-riscv64-musl@1.48.0': + resolution: {integrity: sha512-zwSqxMgmb2ITamNfDv9Q9EKBc/4ZhCBP9gkg2hhcgR6sEVGPUDl1AKPC89CBKMxkmPUi3685C38EvqtZn5OtHw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-s390x-gnu@1.48.0': + resolution: {integrity: sha512-c/+2oUWAOsQB5JTem0rW8ODlZllF6pAtGSGXoLSvPTonKI1vAwaKhD9Qw1X36jRbcI3Etkpu/9z/RRjMba8vFQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@oxlint/binding-linux-x64-gnu@1.48.0': + resolution: {integrity: sha512-PhauDqeFW5DGed6QxCY5lXZYKSlcBdCXJnH03ZNU6QmDZ0BFM/zSy1oPT2MNb1Afx1G6yOOVk8ErjWsQ7c59ng==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxlint/linux-x64-musl@1.43.0': - resolution: {integrity: sha512-+jNYgLGRFTJxJuaSOZJBwlYo5M0TWRw0+3y5MHOL4ArrIdHyCthg6r4RbVWrsR1qUfUE1VSSHQ2bfbC99RXqMg==} + '@oxlint/binding-linux-x64-musl@1.48.0': + resolution: {integrity: sha512-6d7LIFFZGiavbHndhf1cK9kG9qmy2Dmr37sV9Ep7j3H+ciFdKSuOzdLh85mEUYMih+b+esMDlF5DU0WQRZPQjw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxlint/win32-arm64@1.43.0': - resolution: {integrity: sha512-dvs1C/HCjCyGTURMagiHprsOvVTT3omDiSzi5Qw0D4QFJ1pEaNlfBhVnOUYgUfS6O7Mcmj4+G+sidRsQcWQ/kA==} + '@oxlint/binding-openharmony-arm64@1.48.0': + resolution: {integrity: sha512-r+0KK9lK6vFp3tXAgDMOW32o12dxvKS3B9La1uYMGdWAMoSeu2RzG34KmzSpXu6MyLDl4aSVyZLFM8KGdEjwaw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.48.0': + resolution: {integrity: sha512-Nkw/MocyT3HSp0OJsKPXrcbxZqSPMTYnLLfsqsoiFKoL1ppVNL65MFa7vuTxJehPlBkjy+95gUgacZtuNMECrg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxlint/win32-x64@1.43.0': - resolution: {integrity: sha512-bSuItSU8mTSDsvmmLTepTdCL2FkJI6dwt9tot/k0EmiYF+ArRzmsl4lXVLssJNRV5lJEc5IViyTrh7oiwrjUqA==} + '@oxlint/binding-win32-ia32-msvc@1.48.0': + resolution: {integrity: sha512-reO1SpefvRmeZSP+WeyWkQd1ArxxDD1MyKgMUKuB8lNuUoxk9QEohYtKnsfsxJuFwMT0JTr7p9wZjouA85GzGQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.48.0': + resolution: {integrity: sha512-T6zwhfcsrorqAybkOglZdPkTLlEwipbtdO1qjE+flbawvwOMsISoyiuaa7vM7zEyfq1hmDvMq1ndvkYFioranA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] + '@oxlint/plugins@1.48.0': + resolution: {integrity: sha512-kbvtiYwCR0kKUks/UYAsFV/o2jkEnJFTnhcOiU/E23x8TgRSSm6XnA24fmBU1uibxXjw8DU9yT3hS/Gq32/LNw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@rollup/rollup-android-arm-eabi@4.57.0': resolution: {integrity: sha512-tPgXB6cDTndIe1ah7u6amCI1T0SsnlOuKgg10Xh3uizJk4e5M1JGaUMk7J4ciuAUcFpbOiNhm2XIjP9ON0dUqA==} cpu: [arm] @@ -603,12 +684,12 @@ packages: resolution: {integrity: sha512-7rQ3QdJwobMQLMZwQaPuPYMEF2fDRZwf51lZ//V+bA37nejjKW5ifMHbbCwvA889Y4RLhT+/wLJpPRhAoBaZYw==} engines: {node: ^20.19.0 || >=22.12.0} - oxlint@1.43.0: - resolution: {integrity: sha512-xiqTCsKZch+R61DPCjyqUVP2MhkQlRRYxLRBeBDi+dtQJ90MOgdcjIktvDCgXz0bgtx94EQzHEndsizZjMX2OA==} + oxlint@1.48.0: + resolution: {integrity: sha512-m5vyVBgPtPhVCJc3xI//8je9lRc8bYuYB4R/1PH3VPGOjA4vjVhkHtyJukdEjYEjwrw4Qf1eIf+pP9xvfhfMow==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - oxlint-tsgolint: '>=0.11.2' + oxlint-tsgolint: '>=0.12.2' peerDependenciesMeta: oxlint-tsgolint: optional: true @@ -932,30 +1013,65 @@ snapshots: '@oxc-project/types@0.112.0': {} - '@oxlint/darwin-arm64@1.43.0': + '@oxlint/binding-android-arm-eabi@1.48.0': + optional: true + + '@oxlint/binding-android-arm64@1.48.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.48.0': optional: true - '@oxlint/darwin-x64@1.43.0': + '@oxlint/binding-darwin-x64@1.48.0': optional: true - '@oxlint/linux-arm64-gnu@1.43.0': + '@oxlint/binding-freebsd-x64@1.48.0': optional: true - '@oxlint/linux-arm64-musl@1.43.0': + '@oxlint/binding-linux-arm-gnueabihf@1.48.0': optional: true - '@oxlint/linux-x64-gnu@1.43.0': + '@oxlint/binding-linux-arm-musleabihf@1.48.0': optional: true - '@oxlint/linux-x64-musl@1.43.0': + '@oxlint/binding-linux-arm64-gnu@1.48.0': optional: true - '@oxlint/win32-arm64@1.43.0': + '@oxlint/binding-linux-arm64-musl@1.48.0': optional: true - '@oxlint/win32-x64@1.43.0': + '@oxlint/binding-linux-ppc64-gnu@1.48.0': optional: true + '@oxlint/binding-linux-riscv64-gnu@1.48.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.48.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.48.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.48.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.48.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.48.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.48.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.48.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.48.0': + optional: true + + '@oxlint/plugins@1.48.0': {} + '@rollup/rollup-android-arm-eabi@4.57.0': optional: true @@ -1177,16 +1293,27 @@ snapshots: '@oxc-parser/binding-win32-ia32-msvc': 0.112.0 '@oxc-parser/binding-win32-x64-msvc': 0.112.0 - oxlint@1.43.0: + oxlint@1.48.0: optionalDependencies: - '@oxlint/darwin-arm64': 1.43.0 - '@oxlint/darwin-x64': 1.43.0 - '@oxlint/linux-arm64-gnu': 1.43.0 - '@oxlint/linux-arm64-musl': 1.43.0 - '@oxlint/linux-x64-gnu': 1.43.0 - '@oxlint/linux-x64-musl': 1.43.0 - '@oxlint/win32-arm64': 1.43.0 - '@oxlint/win32-x64': 1.43.0 + '@oxlint/binding-android-arm-eabi': 1.48.0 + '@oxlint/binding-android-arm64': 1.48.0 + '@oxlint/binding-darwin-arm64': 1.48.0 + '@oxlint/binding-darwin-x64': 1.48.0 + '@oxlint/binding-freebsd-x64': 1.48.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.48.0 + '@oxlint/binding-linux-arm-musleabihf': 1.48.0 + '@oxlint/binding-linux-arm64-gnu': 1.48.0 + '@oxlint/binding-linux-arm64-musl': 1.48.0 + '@oxlint/binding-linux-ppc64-gnu': 1.48.0 + '@oxlint/binding-linux-riscv64-gnu': 1.48.0 + '@oxlint/binding-linux-riscv64-musl': 1.48.0 + '@oxlint/binding-linux-s390x-gnu': 1.48.0 + '@oxlint/binding-linux-x64-gnu': 1.48.0 + '@oxlint/binding-linux-x64-musl': 1.48.0 + '@oxlint/binding-openharmony-arm64': 1.48.0 + '@oxlint/binding-win32-arm64-msvc': 1.48.0 + '@oxlint/binding-win32-ia32-msvc': 1.48.0 + '@oxlint/binding-win32-x64-msvc': 1.48.0 pathe@2.0.3: {} diff --git a/src/extraction/variable-tracker.ts b/src/extraction/variable-tracker.ts index 64aa845..9f26478 100644 --- a/src/extraction/variable-tracker.ts +++ b/src/extraction/variable-tracker.ts @@ -1,6 +1,6 @@ import type { Context, ESTreeNode } from '../types.js'; import type { VariableInfo, VariableReference, ReferenceType } from './types.js'; -import type { Scope, Variable, Reference } from 'oxlint/plugins'; +import type { Scope, Variable, Reference } from '@oxlint/plugins'; interface IdentifierNode { type: string; diff --git a/src/index.ts b/src/index.ts index 7a2c606..1bd9b02 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import { definePlugin } from 'oxlint/plugins'; +import { definePlugin } from '@oxlint/plugins'; import { maxCyclomatic } from './rules/max-cyclomatic.js'; import { maxCognitive } from './rules/max-cognitive.js'; import { complexity } from './rules/complexity.js'; diff --git a/src/rules/complexity.ts b/src/rules/complexity.ts index f797bd0..f5f649c 100644 --- a/src/rules/complexity.ts +++ b/src/rules/complexity.ts @@ -1,4 +1,4 @@ -import { defineRule } from 'oxlint/plugins'; +import { defineRule } from '@oxlint/plugins'; import type { Rule, Context, diff --git a/src/rules/max-cognitive.ts b/src/rules/max-cognitive.ts index 2d3e523..a740e12 100644 --- a/src/rules/max-cognitive.ts +++ b/src/rules/max-cognitive.ts @@ -1,4 +1,4 @@ -import { defineRule } from 'oxlint/plugins'; +import { defineRule } from '@oxlint/plugins'; import type { Rule, Context, diff --git a/src/rules/shared.ts b/src/rules/shared.ts index fa3c7b7..f2d0388 100644 --- a/src/rules/shared.ts +++ b/src/rules/shared.ts @@ -1,4 +1,4 @@ -import { defineRule } from 'oxlint/plugins'; +import { defineRule } from '@oxlint/plugins'; import type { Rule, Context, diff --git a/src/types.ts b/src/types.ts index b7dd6f0..948f469 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,6 +1,6 @@ -import type { ESTree } from 'oxlint/plugins'; +import type { ESTree } from '@oxlint/plugins'; -export type { Rule, Context, Visitor, VisitorWithHooks, Plugin } from 'oxlint/plugins'; +export type { Rule, Context, Visitor, VisitorWithHooks, Plugin } from '@oxlint/plugins'; export type ESTreeNode = ESTree.Node; export type FunctionNode =