From 49b9f2aa79543f18dab1785574b152b92285e959 Mon Sep 17 00:00:00 2001 From: robonen Date: Sat, 14 Feb 2026 22:49:47 +0700 Subject: [PATCH 1/2] feat(configs/oxlint): add linter --- configs/oxlint/README.md | 54 ++++ configs/oxlint/oxlint.config.ts | 4 + configs/oxlint/package.json | 52 ++++ configs/oxlint/src/compose.ts | 103 ++++++++ configs/oxlint/src/index.ts | 17 ++ configs/oxlint/src/presets/base.ts | 73 ++++++ configs/oxlint/src/presets/imports.ts | 20 ++ configs/oxlint/src/presets/index.ts | 6 + configs/oxlint/src/presets/node.ts | 17 ++ configs/oxlint/src/presets/typescript.ts | 39 +++ configs/oxlint/src/presets/vitest.ts | 35 +++ configs/oxlint/src/presets/vue.ts | 26 ++ configs/oxlint/src/types.ts | 18 ++ configs/oxlint/test/compose.test.ts | 146 +++++++++++ configs/oxlint/tsconfig.json | 6 + configs/oxlint/tsdown.config.ts | 9 + configs/oxlint/vitest.config.ts | 7 + configs/tsconfig/README.md | 42 +-- core/platform/README.md | 24 +- core/platform/oxlint.config.ts | 15 ++ core/platform/package.json | 3 + .../platform/src/browsers/focusGuard/index.ts | 4 +- core/platform/src/multi/debounce/index.ts | 2 + core/stdlib/README.md | 33 ++- core/stdlib/oxlint.config.ts | 4 + core/stdlib/package.json | 3 + core/stdlib/src/async/pool/index.ts | 2 +- core/stdlib/src/async/retry/index.ts | 1 + core/stdlib/src/bits/vector/index.ts | 4 +- core/stdlib/src/collections/get/index.ts | 4 +- .../stdlib/src/math/basic/clamp/index.test.ts | 6 +- core/stdlib/src/objects/omit/index.ts | 3 +- core/stdlib/src/objects/pick/index.ts | 3 +- core/stdlib/src/structs/stack/index.ts | 4 +- core/stdlib/src/sync/mutex/index.ts | 2 - core/stdlib/src/text/template/index.ts | 5 +- .../stdlib/src/text/trigram-distance/index.ts | 2 +- core/stdlib/src/types/js/casts.test.ts | 2 +- core/stdlib/src/types/js/complex.test.ts | 2 +- core/stdlib/src/types/js/complex.ts | 2 +- core/stdlib/src/types/js/primitives.ts | 2 +- .../stdlib/src/types/ts/collections.test-d.ts | 10 +- core/stdlib/src/types/ts/collections.ts | 2 +- core/stdlib/src/types/ts/string.test-d.ts | 2 +- infra/renovate/README.md | 22 +- package.json | 1 + pnpm-lock.yaml | 247 ++++++++++++++++++ pnpm-workspace.yaml | 1 + vitest.config.ts | 1 + web/vue/README.md | 29 +- web/vue/oxlint.config.ts | 4 + web/vue/package.json | 3 + .../browser/useEventListener/index.ts | 22 +- .../browser/useFocusGuard/index.test.ts | 12 +- .../browser/useSupported/index.test.ts | 4 +- .../composables/browser/useSupported/index.ts | 1 + .../component/unrefElement/index.test.ts | 8 +- .../component/useRenderCount/index.test.ts | 2 +- .../component/useRenderCount/index.ts | 3 +- .../component/useRenderInfo/index.test.ts | 10 +- .../component/useRenderInfo/index.ts | 5 +- .../lifecycle/tryOnBeforeMount/index.ts | 3 +- .../lifecycle/tryOnMounted/index.test.ts | 7 +- .../lifecycle/tryOnMounted/index.ts | 3 +- .../lifecycle/tryOnScopeDispose/index.test.ts | 9 +- .../lifecycle/useMounted/index.test.ts | 2 +- .../composables/lifecycle/useMounted/index.ts | 5 +- .../composables/math/useClamp/index.test.ts | 2 +- .../src/composables/math/useClamp/index.ts | 3 +- .../reactivity/useCached/index.test.ts | 2 +- .../composables/reactivity/useCached/index.ts | 3 +- .../reactivity/useLastChanged/index.test.ts | 2 +- .../reactivity/useLastChanged/index.ts | 5 +- .../reactivity/useSyncRefs/index.test.ts | 2 +- .../reactivity/useSyncRefs/index.ts | 5 +- .../state/useAppSharedState/index.test.ts | 2 +- .../state/useAsyncState/index.test.ts | 44 ++-- .../composables/state/useAsyncState/index.ts | 12 +- .../state/useContextFactory/index.test.ts | 2 +- .../state/useContextFactory/index.ts | 3 +- .../state/useCounter/index.test.ts | 2 +- .../src/composables/state/useCounter/index.ts | 12 +- .../state/useInjectionStore/index.ts | 2 +- .../composables/state/useToggle/index.test.ts | 26 +- .../src/composables/state/useToggle/index.ts | 3 +- .../storage/useLocalStorage/index.test.ts | 2 +- .../storage/useLocalStorage/index.ts | 3 +- .../storage/useSessionStorage/index.test.ts | 2 +- .../storage/useSessionStorage/index.ts | 3 +- .../storage/useStorage/index.test.ts | 7 +- .../composables/storage/useStorage/index.ts | 11 +- .../storage/useStorageAsync/index.test.ts | 17 +- .../storage/useStorageAsync/index.ts | 12 +- .../useOffsetPagination/index.test.ts | 12 +- .../utilities/useOffsetPagination/index.ts | 5 +- web/vue/src/types/window.ts | 2 +- web/vue/src/utils/components.ts | 3 +- web/vue/vitest.config.ts | 2 +- 98 files changed, 1236 insertions(+), 201 deletions(-) create mode 100644 configs/oxlint/README.md create mode 100644 configs/oxlint/oxlint.config.ts create mode 100644 configs/oxlint/package.json create mode 100644 configs/oxlint/src/compose.ts create mode 100644 configs/oxlint/src/index.ts create mode 100644 configs/oxlint/src/presets/base.ts create mode 100644 configs/oxlint/src/presets/imports.ts create mode 100644 configs/oxlint/src/presets/index.ts create mode 100644 configs/oxlint/src/presets/node.ts create mode 100644 configs/oxlint/src/presets/typescript.ts create mode 100644 configs/oxlint/src/presets/vitest.ts create mode 100644 configs/oxlint/src/presets/vue.ts create mode 100644 configs/oxlint/src/types.ts create mode 100644 configs/oxlint/test/compose.test.ts create mode 100644 configs/oxlint/tsconfig.json create mode 100644 configs/oxlint/tsdown.config.ts create mode 100644 configs/oxlint/vitest.config.ts create mode 100644 core/platform/oxlint.config.ts create mode 100644 core/stdlib/oxlint.config.ts create mode 100644 web/vue/oxlint.config.ts diff --git a/configs/oxlint/README.md b/configs/oxlint/README.md new file mode 100644 index 0000000..96817c7 --- /dev/null +++ b/configs/oxlint/README.md @@ -0,0 +1,54 @@ +# @robonen/oxlint + +Composable [oxlint](https://oxc.rs/docs/guide/usage/linter.html) configuration presets. + +## Install + +```bash +pnpm install -D @robonen/oxlint oxlint +``` + +## Usage + +Create `oxlint.config.ts` in your project root: + +```ts +import { defineConfig } from 'oxlint'; +import { compose, base, typescript, vue, vitest, imports } from '@robonen/oxlint'; + +export default defineConfig( + compose(base, typescript, vue, vitest, imports), +); +``` + +Append custom rules after presets to override them: + +```ts +compose(base, typescript, { + rules: { 'eslint/no-console': 'off' }, + ignorePatterns: ['dist'], +}); +``` + +## Presets + +| Preset | Description | +| ------------ | -------------------------------------------------- | +| `base` | Core eslint, oxc, unicorn rules | +| `typescript` | TypeScript-specific rules (via overrides) | +| `vue` | Vue 3 Composition API / `