From b49c26160a92469a3cd65d2239a441754f5ee935 Mon Sep 17 00:00:00 2001 From: Jiahan Chen Date: Fri, 14 Aug 2026 10:11:13 +0800 Subject: [PATCH] refactor(config): use injected lint exports Co-authored-by: swwind --- examples/app-react/rstack.config.ts | 15 ++++++--------- examples/app-vanilla/rstack.config.ts | 5 +---- examples/documentation/rstack.config.ts | 15 ++++++--------- examples/lib-node/rstack.config.ts | 5 +---- examples/lib-react/rstack.config.ts | 15 ++++++--------- rstack.config.ts | 3 +-- 6 files changed, 21 insertions(+), 37 deletions(-) diff --git a/examples/app-react/rstack.config.ts b/examples/app-react/rstack.config.ts index 4d23b13c..960e215b 100644 --- a/examples/app-react/rstack.config.ts +++ b/examples/app-react/rstack.config.ts @@ -12,12 +12,9 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - return [ - js.configs.recommended, - ts.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); diff --git a/examples/app-vanilla/rstack.config.ts b/examples/app-vanilla/rstack.config.ts index 3504d640..9707fbda 100644 --- a/examples/app-vanilla/rstack.config.ts +++ b/examples/app-vanilla/rstack.config.ts @@ -6,7 +6,4 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommended]); diff --git a/examples/documentation/rstack.config.ts b/examples/documentation/rstack.config.ts index f73f1863..10c5a9ad 100644 --- a/examples/documentation/rstack.config.ts +++ b/examples/documentation/rstack.config.ts @@ -7,12 +7,9 @@ define.doc({ title: 'My Site', }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - return [ - js.configs.recommended, - ts.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); diff --git a/examples/lib-node/rstack.config.ts b/examples/lib-node/rstack.config.ts index ccafc8da..ed274a80 100644 --- a/examples/lib-node/rstack.config.ts +++ b/examples/lib-node/rstack.config.ts @@ -6,7 +6,4 @@ define.lib({ syntax: ['node 22'], }); -define.lint(async () => { - const { js, ts } = await import('rstack/lint'); - return [js.configs.recommended, ts.configs.recommended]; -}); +define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommended]); diff --git a/examples/lib-react/rstack.config.ts b/examples/lib-react/rstack.config.ts index 31913350..fd97fdae 100644 --- a/examples/lib-react/rstack.config.ts +++ b/examples/lib-react/rstack.config.ts @@ -22,12 +22,9 @@ define.test({ setupFiles: ['./tests/rstest.setup.ts'], }); -define.lint(async () => { - const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint'); - return [ - js.configs.recommended, - ts.configs.recommended, - reactPlugin.configs.recommended, - reactHooksPlugin.configs.recommended, - ]; -}); +define.lint(({ js, ts, reactPlugin, reactHooksPlugin }) => [ + js.configs.recommended, + ts.configs.recommended, + reactPlugin.configs.recommended, + reactHooksPlugin.configs.recommended, +]); diff --git a/rstack.config.ts b/rstack.config.ts index d6d1bce2..3e20de09 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -1,9 +1,8 @@ // Rstack configuration guide: https://rstack.rs/config import { define } from 'rstack'; -define.lint(async () => { +define.lint(async ({ js, ts }) => { const { default: globals } = await import('globals'); - const { js, ts } = await import('rstack/lint'); return [ js.configs.recommended, ts.configs.recommendedTypeChecked,