diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 98d08a6eb..a3311b458 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,3 @@ { - "recommendations": [ - "vitest.explorer", - "dbaeumer.vscode-eslint", - "oxc.oxc-vscode" - ] + "recommendations": ["vitest.explorer", "oxc.oxc-vscode"] } diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index 13590a629..000000000 --- a/eslint.config.js +++ /dev/null @@ -1,23 +0,0 @@ -// @ts-check - -// @ts-ignore Needed due to moduleResolution Node vs Bundler -import { tanstackConfig } from '@tanstack/eslint-config' -import unusedImports from 'eslint-plugin-unused-imports' - -export default [ - ...tanstackConfig, - { - name: 'tanstack/temp', - plugins: { - 'unused-imports': unusedImports, - }, - rules: { - 'import/order': 'off', - 'no-case-declarations': 'off', - 'no-shadow': 'off', - 'unused-imports/no-unused-imports': 'warn', - 'pnpm/enforce-catalog': 'off', - 'pnpm/json-enforce-catalog': 'off', - }, - }, -] diff --git a/knip.json b/knip.json index d06c33691..418a1b07b 100644 --- a/knip.json +++ b/knip.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/knip@5/schema.json", - "ignoreDependencies": ["@faker-js/faker"], + "ignoreDependencies": ["@faker-js/faker", "eslint-plugin-unused-imports"], "ignoreWorkspaces": ["examples/**", "e2e/**"], "workspaces": { ".": { diff --git a/nx.json b/nx.json index a3117c1bd..5648eebeb 100644 --- a/nx.json +++ b/nx.json @@ -21,7 +21,7 @@ "production": [ "default", "!{projectRoot}/tests/**/*", - "!{projectRoot}/eslint.config.js" + "!{projectRoot}/oxlint.config.ts" ] }, "targetDefaults": { @@ -31,10 +31,10 @@ "inputs": ["default", "^production"], "outputs": ["{projectRoot}/coverage"] }, - "test:eslint": { + "test:oxlint": { "cache": true, "dependsOn": ["^build"], - "inputs": ["default", "^production", "{workspaceRoot}/eslint.config.js"] + "inputs": ["default", "^production", "{workspaceRoot}/oxlint.config.ts"] }, "test:types": { "cache": true, diff --git a/oxlint.config.ts b/oxlint.config.ts new file mode 100644 index 000000000..188e0d5cd --- /dev/null +++ b/oxlint.config.ts @@ -0,0 +1,20 @@ +import { tanstackConfig } from '@tanstack/oxlint-config' +import { defineConfig } from 'oxlint' + +export default defineConfig({ + extends: [tanstackConfig], + jsPlugins: [ + { name: 'unused-imports', specifier: 'eslint-plugin-unused-imports' }, + ], + env: tanstackConfig.env, + ignorePatterns: [ + 'examples/**', + 'e2e/**', + ...(tanstackConfig.ignorePatterns ?? []), + ], + rules: { + 'no-case-declarations': 'off', + 'no-shadow': 'off', + 'unused-imports/no-unused-imports': 'warn', + }, +}) diff --git a/package.json b/package.json index f9381960c..20d2a6034 100644 --- a/package.json +++ b/package.json @@ -29,13 +29,13 @@ "size": "size-limit", "test": "pnpm run test:ci", "test:build": "nx affected --target=test:build --exclude=examples/**", - "test:ci": "nx run-many --targets=test:eslint,test:sherif,test:knip,test:lib,test:types,test:build,build", + "test:ci": "nx run-many --targets=test:oxlint,test:sherif,test:knip,test:lib,test:types,test:build,build", "test:docs": "node scripts/verify-links.ts", - "test:eslint": "nx affected --target=test:eslint --exclude=examples/**", + "test:oxlint": "nx affected --target=test:oxlint --exclude=examples/**", "test:knip": "knip", "test:lib": "nx affected --targets=test:lib --exclude=examples/**", "test:lib:dev": "pnpm test:lib && nx watch --all -- pnpm test:lib", - "test:pr": "nx affected --targets=test:eslint,test:sherif,test:knip,test:lib,test:types,test:build,build", + "test:pr": "nx affected --targets=test:oxlint,test:sherif,test:knip,test:lib,test:types,test:build,build", "test:e2e": "nx run-many --target=test:e2e --parallel=1 --projects=devtools-e2e-react-vite,devtools-e2e-react-start,devtools-e2e-react-cloudflare,devtools-e2e-react-nitro,devtools-e2e-solid,devtools-e2e-solid1,devtools-e2e-vue,devtools-e2e-preact,devtools-e2e-angular", "test:sherif": "sherif", "test:types": "nx affected --targets=test:types --exclude=examples/**", @@ -79,20 +79,21 @@ "@faker-js/faker": "^9.9.0", "@size-limit/preset-small-lib": "^11.2.0", "@solidjs/babel-plugin": "^2.0.0", - "@tanstack/eslint-config": "0.3.2", "@tanstack/intent": "^0.0.14", "@tanstack/oxfmt-config": "0.1.0", + "@tanstack/oxlint-config": "0.2.0", "@tanstack/typedoc-config": "0.3.3", "@tanstack/vite-config": "0.4.3", "@testing-library/jest-dom": "^6.8.0", "@types/node": "^22.15.2", - "eslint": "^9.36.0", "eslint-plugin-unused-imports": "^4.2.0", "jsdom": "^27.0.0", "knip": "^5.64.0", "markdown-link-extractor": "^4.0.2", "nx": "22.1.3", "oxfmt": "0.81.0", + "oxlint": "^1.96.0", + "oxlint-tsgolint": "^7.0.2009", "premove": "^4.0.0", "publint": "^0.3.13", "sherif": "^1.7.0", diff --git a/packages/angular-devtools/eslint.config.js b/packages/angular-devtools/eslint.config.js deleted file mode 100644 index 8ce6ad05f..000000000 --- a/packages/angular-devtools/eslint.config.js +++ /dev/null @@ -1,5 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [...rootConfig] diff --git a/packages/angular-devtools/oxlint.config.ts b/packages/angular-devtools/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/angular-devtools/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/angular-devtools/package.json b/packages/angular-devtools/package.json index cfc3e1ff6..787a051ba 100644 --- a/packages/angular-devtools/package.json +++ b/packages/angular-devtools/package.json @@ -48,7 +48,7 @@ ], "scripts": { "clean": "premove ./build ./dist", - "test:eslint": "eslint ./src", + "test:oxlint": "oxlint ./src", "test:lib": "vitest --passWithNoTests", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/angular-devtools/src/devtools.ts b/packages/angular-devtools/src/devtools.ts index b02c28c9b..51504b43e 100644 --- a/packages/angular-devtools/src/devtools.ts +++ b/packages/angular-devtools/src/devtools.ts @@ -2,12 +2,10 @@ import { ApplicationRef, ChangeDetectionStrategy, Component, - ComponentRef, DestroyRef, ElementRef, EnvironmentInjector, Injector, - Type, afterNextRender, computed, createComponent, @@ -21,7 +19,7 @@ import { untracked, } from '@angular/core' import { PLUGIN_CONTAINER_ID, TanStackDevtoolsCore } from '@tanstack/devtools' -import type { Signal } from '@angular/core' +import type { ComponentRef, Signal, Type } from '@angular/core' import type { TanStackDevtoolsPlugin } from '@tanstack/devtools' import type { TanStackDevtoolsAngularFunctionalComponent, diff --git a/packages/angular-devtools/tsconfig.json b/packages/angular-devtools/tsconfig.json index 6dbf9c55a..331a441bb 100644 --- a/packages/angular-devtools/tsconfig.json +++ b/packages/angular-devtools/tsconfig.json @@ -23,5 +23,5 @@ "strictTemplates": true, "compilationMode": "partial" }, - "include": ["src", "provider", "tests", "eslint.config.js", "vite.config.ts"] + "include": ["src", "provider", "tests", "oxlint.config.ts", "vite.config.ts"] } diff --git a/packages/devtools-a11y/eslint.config.js b/packages/devtools-a11y/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-a11y/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-a11y/oxlint.config.ts b/packages/devtools-a11y/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-a11y/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-a11y/package.json b/packages/devtools-a11y/package.json index d9d7fd213..18885e9b1 100644 --- a/packages/devtools-a11y/package.json +++ b/packages/devtools-a11y/package.json @@ -87,8 +87,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-a11y/src/core/utils/ally-audit.utils.ts b/packages/devtools-a11y/src/core/utils/ally-audit.utils.ts index 461676426..d53102fd3 100644 --- a/packages/devtools-a11y/src/core/utils/ally-audit.utils.ts +++ b/packages/devtools-a11y/src/core/utils/ally-audit.utils.ts @@ -233,12 +233,12 @@ export async function runAudit( } // Determine the context to audit - let auditContext: axe.ElementContext = context as axe.ElementContext + let auditContext: axe.ElementContext = context // Add exclusions if specified (always include devtools exclusions) if (allExclusions.length > 0) { auditContext = { - include: [auditContext as Element], + include: [auditContext], exclude: allExclusions.map((sel) => [sel]), } as axe.ElementContext } diff --git a/packages/devtools-a11y/tsconfig.json b/packages/devtools-a11y/tsconfig.json index d905f5813..184ed338c 100644 --- a/packages/devtools-a11y/tsconfig.json +++ b/packages/devtools-a11y/tsconfig.json @@ -4,5 +4,5 @@ "jsx": "preserve", "jsxImportSource": "@solidjs/web" }, - "include": ["src", "tests", "eslint.config.js", "vite.config.ts"] + "include": ["src", "tests", "oxlint.config.ts", "vite.config.ts"] } diff --git a/packages/devtools-bundler-core/eslint.config.js b/packages/devtools-bundler-core/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-bundler-core/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-bundler-core/oxlint.config.ts b/packages/devtools-bundler-core/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-bundler-core/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-bundler-core/package.json b/packages/devtools-bundler-core/package.json index 983a7e783..69cdfde98 100644 --- a/packages/devtools-bundler-core/package.json +++ b/packages/devtools-bundler-core/package.json @@ -42,8 +42,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-bundler-core/src/runtime-bridge.test.ts b/packages/devtools-bundler-core/src/runtime-bridge.test.ts index 5b93a7c58..82b5eb178 100644 --- a/packages/devtools-bundler-core/src/runtime-bridge.test.ts +++ b/packages/devtools-bundler-core/src/runtime-bridge.test.ts @@ -105,7 +105,7 @@ describe('wireRuntimeBridgeChannels', () => { received.push((e as CustomEvent).detail), ) - wireRuntimeBridgeChannels(server as any, () => target) + wireRuntimeBridgeChannels(server, () => target) const evt = { type: 'q:foo', payload: 1 } ssr.__handlers['tsd:to-server']!(evt) @@ -117,7 +117,7 @@ describe('wireRuntimeBridgeChannels', () => { const ssr = makeEnv() const server = { environments: { ssr } } - wireRuntimeBridgeChannels(server as any, () => target) + wireRuntimeBridgeChannels(server, () => target) const evt = { type: 'q:bar', payload: 2 } target.dispatchEvent( new CustomEvent('tanstack-devtools-global', { detail: evt }), @@ -129,7 +129,7 @@ describe('wireRuntimeBridgeChannels', () => { test('skips the client environment', () => { const client = makeEnv() const server = { environments: { client } } - wireRuntimeBridgeChannels(server as any, () => new EventTarget()) + wireRuntimeBridgeChannels(server, () => new EventTarget()) expect(client.__handlers['tsd:to-server']).toBeUndefined() }) @@ -137,7 +137,7 @@ describe('wireRuntimeBridgeChannels', () => { const target = new EventTarget() const ssr = makeEnv() const server = { environments: { ssr } } - const teardown = wireRuntimeBridgeChannels(server as any, () => target) + const teardown = wireRuntimeBridgeChannels(server, () => target) teardown() target.dispatchEvent( new CustomEvent('tanstack-devtools-global', { detail: { type: 'x' } }), @@ -149,7 +149,7 @@ describe('wireRuntimeBridgeChannels', () => { const target = new EventTarget() const ssr = makeEnv() const server = { environments: { ssr } } - const teardown = wireRuntimeBridgeChannels(server as any, () => target) + const teardown = wireRuntimeBridgeChannels(server, () => target) // Capture the registered handler reference before teardown. const registeredHandler = ssr.__handlers['tsd:to-server'] diff --git a/packages/devtools-bundler-core/tsconfig.json b/packages/devtools-bundler-core/tsconfig.json index eb6383595..00d971867 100644 --- a/packages/devtools-bundler-core/tsconfig.json +++ b/packages/devtools-bundler-core/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig.json", - "include": ["src", "eslint.config.js", "vite.config.ts"] + "include": ["src", "oxlint.config.ts", "vite.config.ts"] } diff --git a/packages/devtools-client/eslint.config.js b/packages/devtools-client/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-client/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-client/oxlint.config.ts b/packages/devtools-client/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-client/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-client/package.json b/packages/devtools-client/package.json index cad4d2f90..2669177e3 100644 --- a/packages/devtools-client/package.json +++ b/packages/devtools-client/package.json @@ -43,8 +43,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest --passWithNoTests", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-client/tsconfig.json b/packages/devtools-client/tsconfig.json index 9addc1ae5..93bc6f0cd 100644 --- a/packages/devtools-client/tsconfig.json +++ b/packages/devtools-client/tsconfig.json @@ -3,7 +3,7 @@ "include": [ "src", "tsup.config.ts", - "eslint.config.js", + "oxlint.config.ts", "vite.config.ts", "tests", "vite.config.solid.ts" diff --git a/packages/devtools-rspack/eslint.config.js b/packages/devtools-rspack/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-rspack/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-rspack/oxlint.config.ts b/packages/devtools-rspack/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-rspack/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-rspack/package.json b/packages/devtools-rspack/package.json index c7ae52c2f..f1459d218 100644 --- a/packages/devtools-rspack/package.json +++ b/packages/devtools-rspack/package.json @@ -43,8 +43,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-rspack/tsconfig.json b/packages/devtools-rspack/tsconfig.json index eb6383595..00d971867 100644 --- a/packages/devtools-rspack/tsconfig.json +++ b/packages/devtools-rspack/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig.json", - "include": ["src", "eslint.config.js", "vite.config.ts"] + "include": ["src", "oxlint.config.ts", "vite.config.ts"] } diff --git a/packages/devtools-ui/eslint.config.js b/packages/devtools-ui/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-ui/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-ui/oxlint.config.ts b/packages/devtools-ui/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-ui/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-ui/package.json b/packages/devtools-ui/package.json index d0b42f915..71e00141c 100644 --- a/packages/devtools-ui/package.json +++ b/packages/devtools-ui/package.json @@ -56,8 +56,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-ui/tsconfig.json b/packages/devtools-ui/tsconfig.json index 9781176da..e34a47acf 100644 --- a/packages/devtools-ui/tsconfig.json +++ b/packages/devtools-ui/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "include": [ "src", - "eslint.config.js", + "oxlint.config.ts", "vite.config.ts", "tests", "src/server" diff --git a/packages/devtools-utils/eslint.config.js b/packages/devtools-utils/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-utils/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-utils/oxlint.config.ts b/packages/devtools-utils/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-utils/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-utils/package.json b/packages/devtools-utils/package.json index 1c713d769..6f2aeb56d 100644 --- a/packages/devtools-utils/package.json +++ b/packages/devtools-utils/package.json @@ -141,8 +141,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-utils/tsconfig.json b/packages/devtools-utils/tsconfig.json index edde1f95a..684bbb118 100644 --- a/packages/devtools-utils/tsconfig.json +++ b/packages/devtools-utils/tsconfig.json @@ -7,7 +7,7 @@ "include": [ "src", "tsup.config.ts", - "eslint.config.js", + "oxlint.config.ts", "vite.config.ts", "vite.config.preact.ts", "vite.config.vue.ts", diff --git a/packages/devtools-vite/eslint.config.js b/packages/devtools-vite/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-vite/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-vite/oxlint.config.ts b/packages/devtools-vite/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-vite/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-vite/package.json b/packages/devtools-vite/package.json index 3e7bb463e..80b25e164 100644 --- a/packages/devtools-vite/package.json +++ b/packages/devtools-vite/package.json @@ -44,8 +44,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-vite/src/plugin.ts b/packages/devtools-vite/src/plugin.ts index 60bb7bffd..aa861147c 100644 --- a/packages/devtools-vite/src/plugin.ts +++ b/packages/devtools-vite/src/plugin.ts @@ -27,7 +27,6 @@ import type { EditorConfig, TanStackDevtoolsConfig, } from '@tanstack/devtools-bundler-core' -import type { HttpServerLike } from '@tanstack/devtools-event-bus/server' import type { Plugin } from 'vite' export type { ConsoleLevel } from '@tanstack/devtools-bundler-core' @@ -129,16 +128,14 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { // When HTTPS is enabled, piggyback on Vite's server // so WebSocket/SSE connections share the same TLS certificate ...(isHttps && server.httpServer - ? { httpServer: server.httpServer as HttpServerLike } + ? { httpServer: server.httpServer } : {}), }) // start() now handles EADDRINUSE and returns the actual port devtoolsPort = await bus.start() if ((server as any).environments) { const teardownBridge = wireRuntimeBridgeChannels( - server as unknown as Parameters< - typeof wireRuntimeBridgeChannels - >[0], + server, () => globalThis.__TANSTACK_EVENT_TARGET__, ) server.httpServer?.on('close', teardownBridge) diff --git a/packages/devtools-vite/tsconfig.json b/packages/devtools-vite/tsconfig.json index 44533f71c..bacd1f3a5 100644 --- a/packages/devtools-vite/tsconfig.json +++ b/packages/devtools-vite/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig.json", - "include": ["src", "eslint.config.js", "vite.config.ts", "tests"] + "include": ["src", "oxlint.config.ts", "vite.config.ts", "tests"] } diff --git a/packages/devtools-webmcp/eslint.config.js b/packages/devtools-webmcp/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools-webmcp/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools-webmcp/oxlint.config.ts b/packages/devtools-webmcp/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools-webmcp/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools-webmcp/package.json b/packages/devtools-webmcp/package.json index 35ac6e8ee..81655812e 100644 --- a/packages/devtools-webmcp/package.json +++ b/packages/devtools-webmcp/package.json @@ -59,8 +59,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools-webmcp/tsconfig.json b/packages/devtools-webmcp/tsconfig.json index 44533f71c..bacd1f3a5 100644 --- a/packages/devtools-webmcp/tsconfig.json +++ b/packages/devtools-webmcp/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig.json", - "include": ["src", "eslint.config.js", "vite.config.ts", "tests"] + "include": ["src", "oxlint.config.ts", "vite.config.ts", "tests"] } diff --git a/packages/devtools/eslint.config.js b/packages/devtools/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/devtools/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/devtools/oxlint.config.ts b/packages/devtools/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/devtools/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/devtools/package.json b/packages/devtools/package.json index 1f546481b..a296c2723 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -55,8 +55,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/devtools/src/devtools.tsx b/packages/devtools/src/devtools.tsx index 0a8d1253c..af64e9ca7 100644 --- a/packages/devtools/src/devtools.tsx +++ b/packages/devtools/src/devtools.tsx @@ -105,7 +105,7 @@ export default function DevTools() { onCleanup( devtoolsEventClient.on('trigger-toggled', (event) => { if (pip().pipWindow) return - const payload = event.payload as unknown as { isOpen: boolean } + const payload = event.payload if (payload.isOpen !== isOpen()) { setIsOpen(payload.isOpen) setPersistOpen(payload.isOpen) diff --git a/packages/devtools/src/utils/sanitize.ts b/packages/devtools/src/utils/sanitize.ts index 2a1a32ff0..a2abf6210 100644 --- a/packages/devtools/src/utils/sanitize.ts +++ b/packages/devtools/src/utils/sanitize.ts @@ -15,7 +15,7 @@ export const getAllPermutations = (arr: Array) => { function permutate(arr: Array, start: number) { if (start === arr.length - 1) { - res.push([...arr] as any) + res.push([...arr]) return } for (let i = start; i < arr.length; i++) { diff --git a/packages/event-bus-client/eslint.config.js b/packages/event-bus-client/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/event-bus-client/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/event-bus-client/oxlint.config.ts b/packages/event-bus-client/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/event-bus-client/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/event-bus-client/package.json b/packages/event-bus-client/package.json index 50630c69f..0933c6477 100644 --- a/packages/event-bus-client/package.json +++ b/packages/event-bus-client/package.json @@ -59,8 +59,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/event-bus-client/tsconfig.json b/packages/event-bus-client/tsconfig.json index 1838eb238..c14bde35f 100644 --- a/packages/event-bus-client/tsconfig.json +++ b/packages/event-bus-client/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "include": [ "src", - "eslint.config.js", + "oxlint.config.ts", "vite.config.ts", "tests", "src/server" diff --git a/packages/event-bus/eslint.config.js b/packages/event-bus/eslint.config.js deleted file mode 100644 index e472c69e7..000000000 --- a/packages/event-bus/eslint.config.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - rules: {}, - }, -] diff --git a/packages/event-bus/oxlint.config.ts b/packages/event-bus/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/event-bus/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/event-bus/package.json b/packages/event-bus/package.json index 7bab42660..9b9f201ae 100644 --- a/packages/event-bus/package.json +++ b/packages/event-bus/package.json @@ -67,8 +67,8 @@ ], "scripts": { "clean": "premove ./build ./dist", - "lint:fix": "eslint ./src --fix", - "test:eslint": "eslint ./src", + "lint:fix": "oxlint ./src --fix", + "test:oxlint": "oxlint ./src", "test:lib": "vitest", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/event-bus/tsconfig.json b/packages/event-bus/tsconfig.json index 1838eb238..c14bde35f 100644 --- a/packages/event-bus/tsconfig.json +++ b/packages/event-bus/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "include": [ "src", - "eslint.config.js", + "oxlint.config.ts", "vite.config.ts", "tests", "src/server" diff --git a/packages/preact-devtools/eslint.config.js b/packages/preact-devtools/eslint.config.js deleted file mode 100644 index 8f561f824..000000000 --- a/packages/preact-devtools/eslint.config.js +++ /dev/null @@ -1,18 +0,0 @@ -// @ts-check - -import pluginReactHooks from 'eslint-plugin-react-hooks' -import rootConfig from '../../eslint.config.js' - -/** @type {import('eslint').Linter.Config[]} */ -export default [ - ...rootConfig, - { - plugins: { - 'react-hooks': pluginReactHooks, - }, - rules: { - 'react-hooks/exhaustive-deps': 'error', - 'react-hooks/rules-of-hooks': 'error', - }, - }, -] diff --git a/packages/preact-devtools/oxlint.config.ts b/packages/preact-devtools/oxlint.config.ts new file mode 100644 index 000000000..4b2c05931 --- /dev/null +++ b/packages/preact-devtools/oxlint.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, + plugins: ['react'], + rules: { + // 'eslint-plugin-react-hooks' + 'react/exhaustive-deps': 'error', + 'react/rules-of-hooks': 'error', + }, +}) diff --git a/packages/preact-devtools/package.json b/packages/preact-devtools/package.json index 471e562ce..572dfdea3 100644 --- a/packages/preact-devtools/package.json +++ b/packages/preact-devtools/package.json @@ -43,7 +43,7 @@ ], "scripts": { "clean": "premove ./build ./dist", - "test:eslint": "eslint ./src", + "test:oxlint": "oxlint ./src", "test:lib": "vitest --passWithNoTests", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", @@ -55,7 +55,6 @@ }, "devDependencies": { "@preact/preset-vite": "^2.10.3", - "eslint-plugin-react-hooks": "^7.0.1", "preact": "^11.0.1" }, "peerDependencies": { diff --git a/packages/preact-devtools/tsconfig.json b/packages/preact-devtools/tsconfig.json index f548145d7..f4406e0dd 100644 --- a/packages/preact-devtools/tsconfig.json +++ b/packages/preact-devtools/tsconfig.json @@ -4,5 +4,5 @@ "jsx": "react-jsx", "jsxImportSource": "preact" }, - "include": ["src", "eslint.config.js", "vite.config.ts", "tests"] + "include": ["src", "oxlint.config.ts", "vite.config.ts", "tests"] } diff --git a/packages/react-devtools/eslint.config.js b/packages/react-devtools/eslint.config.js deleted file mode 100644 index 3b8dc1504..000000000 --- a/packages/react-devtools/eslint.config.js +++ /dev/null @@ -1,32 +0,0 @@ -// @ts-check - -import pluginReact from '@eslint-react/eslint-plugin' -import pluginReactCompiler from 'eslint-plugin-react-compiler' -import pluginReactHooks from 'eslint-plugin-react-hooks' -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - files: ['**/*.{ts,tsx}'], - ...pluginReact.configs.recommended, - }, - { - plugins: { - 'react-hooks': pluginReactHooks, - 'react-compiler': pluginReactCompiler, - }, - rules: { - '@eslint-react/dom/no-missing-button-type': 'off', - 'react-compiler/react-compiler': 'error', - 'react-hooks/exhaustive-deps': 'error', - 'react-hooks/rules-of-hooks': 'error', - }, - }, - { - files: ['**/__tests__/**'], - rules: { - // 'react-compiler/react-compiler': 'off', - }, - }, -] diff --git a/packages/react-devtools/oxlint.config.ts b/packages/react-devtools/oxlint.config.ts new file mode 100644 index 000000000..a9462199d --- /dev/null +++ b/packages/react-devtools/oxlint.config.ts @@ -0,0 +1,56 @@ +import { createRequire } from 'node:module' +import pluginReact from '@eslint-react/eslint-plugin' +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +/** + * '@eslint-react/eslint-plugin' v1 bundles one plugin per rule prefix, so each + * one is loaded as its own JS plugin, resolved from the bundling package. + */ +const requireFromEslintReact = createRequire( + createRequire(import.meta.url).resolve('@eslint-react/eslint-plugin'), +) +const eslintReactPlugins = [ + { name: '@eslint-react', specifier: 'eslint-plugin-react-x' }, + { name: '@eslint-react/dom', specifier: 'eslint-plugin-react-dom' }, + { name: '@eslint-react/web-api', specifier: 'eslint-plugin-react-web-api' }, + { + name: '@eslint-react/hooks-extra', + specifier: 'eslint-plugin-react-hooks-extra', + }, + { + name: '@eslint-react/naming-convention', + specifier: 'eslint-plugin-react-naming-convention', + }, +].map(({ name, specifier }) => ({ + name, + specifier: requireFromEslintReact.resolve(specifier), +})) + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, + plugins: ['react'], + jsPlugins: eslintReactPlugins, + rules: { + // 'eslint-plugin-react-hooks' + 'react/exhaustive-deps': 'error', + 'react/rules-of-hooks': 'error', + // 'eslint-plugin-react-compiler' + 'react/error-boundaries': 'error', + 'react/globals': 'error', + 'react/immutability': 'error', + 'react/incompatible-library': 'error', + 'react/preserve-manual-memoization': 'error', + 'react/purity': 'error', + 'react/refs': 'error', + 'react/set-state-in-effect': 'error', + 'react/set-state-in-render': 'error', + 'react/static-components': 'error', + 'react/unsupported-syntax': 'error', + 'react/use-memo': 'error', + // '@eslint-react/eslint-plugin' + ...pluginReact.configs.recommended.rules, + '@eslint-react/dom/no-missing-button-type': 'off', + }, +}) diff --git a/packages/react-devtools/package.json b/packages/react-devtools/package.json index 4233b627f..b753fd457 100644 --- a/packages/react-devtools/package.json +++ b/packages/react-devtools/package.json @@ -43,7 +43,7 @@ ], "scripts": { "clean": "premove ./build ./dist", - "test:eslint": "eslint ./src", + "test:oxlint": "oxlint ./src", "test:lib": "vitest --passWithNoTests", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", @@ -59,8 +59,6 @@ "@types/react": "^19.2.0", "@types/react-dom": "^19.2.0", "@vitejs/plugin-react": "^6.0.1", - "eslint-plugin-react-compiler": "19.1.0-rc.2", - "eslint-plugin-react-hooks": "^7.0.1", "react": "^19.2.0", "react-dom": "^19.2.0" }, diff --git a/packages/react-devtools/tsconfig.json b/packages/react-devtools/tsconfig.json index 84562bb4a..7ba57a636 100644 --- a/packages/react-devtools/tsconfig.json +++ b/packages/react-devtools/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "jsx": "react" }, - "include": ["src", "eslint.config.js", "vite.config.ts", "tests"] + "include": ["src", "oxlint.config.ts", "vite.config.ts", "tests"] } diff --git a/packages/solid-devtools/eslint.config.js b/packages/solid-devtools/eslint.config.js deleted file mode 100644 index ae70adeed..000000000 --- a/packages/solid-devtools/eslint.config.js +++ /dev/null @@ -1,18 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - { - files: ['**/*.{ts,tsx}'], - }, - { - plugins: {}, - rules: {}, - }, - { - files: ['**/__tests__/**'], - rules: {}, - }, -] diff --git a/packages/solid-devtools/oxlint.config.ts b/packages/solid-devtools/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/solid-devtools/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/solid-devtools/package.json b/packages/solid-devtools/package.json index 101b5da36..7f79492c0 100644 --- a/packages/solid-devtools/package.json +++ b/packages/solid-devtools/package.json @@ -43,7 +43,7 @@ ], "scripts": { "clean": "premove ./build ./dist", - "test:eslint": "eslint ./src", + "test:oxlint": "oxlint ./src", "test:lib": "vitest --passWithNoTests", "test:lib:dev": "pnpm test:lib --watch", "test:types": "tsc", diff --git a/packages/solid-devtools/tsconfig.json b/packages/solid-devtools/tsconfig.json index 1ddb0468a..58a68545f 100644 --- a/packages/solid-devtools/tsconfig.json +++ b/packages/solid-devtools/tsconfig.json @@ -4,5 +4,5 @@ "jsx": "preserve", "jsxImportSource": "@solidjs/web" }, - "include": ["src", "eslint.config.js", "vite.config.ts", "tests"] + "include": ["src", "oxlint.config.ts", "vite.config.ts", "tests"] } diff --git a/packages/svelte-devtools/eslint.config.js b/packages/svelte-devtools/eslint.config.js deleted file mode 100644 index 8ce6ad05f..000000000 --- a/packages/svelte-devtools/eslint.config.js +++ /dev/null @@ -1,5 +0,0 @@ -// @ts-check - -import rootConfig from '../../eslint.config.js' - -export default [...rootConfig] diff --git a/packages/svelte-devtools/oxlint.config.ts b/packages/svelte-devtools/oxlint.config.ts new file mode 100644 index 000000000..9ff9ba8e5 --- /dev/null +++ b/packages/svelte-devtools/oxlint.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +export default defineConfig({ + extends: [rootConfig], + env: rootConfig.env, +}) diff --git a/packages/svelte-devtools/package.json b/packages/svelte-devtools/package.json index 175024596..990df03a1 100644 --- a/packages/svelte-devtools/package.json +++ b/packages/svelte-devtools/package.json @@ -40,7 +40,7 @@ ], "scripts": { "clean": "premove ./build ./dist", - "test:eslint": "eslint ./src", + "test:oxlint": "oxlint ./src", "test:lib": "vitest --passWithNoTests", "test:lib:dev": "pnpm test:lib --watch", "test:types": "svelte-check", diff --git a/packages/svelte-devtools/tsconfig.json b/packages/svelte-devtools/tsconfig.json index b958fa556..c08c3ae98 100644 --- a/packages/svelte-devtools/tsconfig.json +++ b/packages/svelte-devtools/tsconfig.json @@ -4,7 +4,7 @@ "include": [ "src", "tests", - "eslint.config.js", + "oxlint.config.ts", "vite.config.ts", "**/*.svelte" ], diff --git a/packages/vue-devtools/eslint.config.js b/packages/vue-devtools/eslint.config.js deleted file mode 100644 index 798ef69f9..000000000 --- a/packages/vue-devtools/eslint.config.js +++ /dev/null @@ -1,17 +0,0 @@ -// @ts-check - -import pluginVue from 'eslint-plugin-vue' -import rootConfig from '../../eslint.config.js' - -export default [ - ...rootConfig, - ...pluginVue.configs['flat/recommended'], - { - files: ['*.vue', '**/*.vue'], - languageOptions: { - parserOptions: { - parser: '@typescript-eslint/parser', - }, - }, - }, -] diff --git a/packages/vue-devtools/oxlint.config.ts b/packages/vue-devtools/oxlint.config.ts new file mode 100644 index 000000000..96c524c54 --- /dev/null +++ b/packages/vue-devtools/oxlint.config.ts @@ -0,0 +1,52 @@ +import { defineConfig } from 'oxlint' +import rootConfig from '../../oxlint.config.ts' + +/** + * Native Oxlint equivalent of 'eslint-plugin-vue' 'flat/recommended'. + * + * Only the rules Oxlint implements are ported. Template rules are not, because + * Oxlint only lints the `