Title: rs test / rs lint run with an empty config when define.test() / define.lint() is missing: intended or an oversight? · Issue #490 · rstackjs/rstack-cli · GitHub
Open Graph Title: rs test / rs lint run with an empty config when define.test() / define.lint() is missing: intended or an oversight? · Issue #490 · rstackjs/rstack-cli
X Title: rs test / rs lint run with an empty config when define.test() / define.lint() is missing: intended or an oversight? · Issue #490 · rstackjs/rstack-cli
Description: What happens When rstack.config.ts only defines define.lint() and define.fmt() (no define.test()), rs test still starts Rstest with an empty config {}, scans the whole directory with the default include, and runs whatever it finds. A rea...
Open Graph Description: What happens When rstack.config.ts only defines define.lint() and define.fmt() (no define.test()), rs test still starts Rstest with an empty config {}, scans the whole directory with the default in...
X Description: What happens When rstack.config.ts only defines define.lint() and define.fmt() (no define.test()), rs test still starts Rstest with an empty config {}, scans the whole directory with the default in...
Opengraph URL: https://github.com/rstackjs/rstack-cli/issues/490
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"rs test / rs lint run with an empty config when define.test() / define.lint() is missing: intended or an oversight?","articleBody":"## What happens\n\nWhen `rstack.config.ts` only defines `define.lint()` and `define.fmt()` (no `define.test()`), `rs test` still starts Rstest with an empty config `{}`, scans the whole directory with the default `include`, and runs whatever it finds.\n\nA real case is the rspack-examples repo. The root `rstack.config.ts` has lint, fmt and staged only. `rstest/module-federation-node/host/` has its own `rstest.config.ts` that registers `remote/*` through the `@module-federation/rstest` plugin. Running `rs test` at the repo root collects `host/tests/federated-modules.test.ts` too, but with the root's empty config and no federation plugin, so it fails with `Cannot find module 'remote/formatPrice'` (exit 1). Running `rstest` inside `host/` passes. A minimal fixture with the same layout reproduces the same result.\n\nAnother case is a repo that uses vitest. `rs test` picks up `src/sum.test.ts` and fails while loading it with `Vitest failed to find the current suite` (exit 1).\n\n`rs lint` behaves the same way: without `define.lint()` it runs with `[]`, prints `Lint passed (2 files, 0 rules)` and exits 0, reporting nothing for `debugger` statements or unused variables.\n\nEnvironment: rstack 0.7.4, @rstest/core 0.11.12 (rstack itself depends on `~0.11.12`, so it is always installed alongside rstack), vitest 5.0.1, Node 26.5.0.\n\n## History\n\nI went through the git history and the issues and could not find this fallback being discussed:\n\n- The `{}` fallback for test comes from 2dc4974 (feat: support for defining test config). The `[]` fallback for lint comes from c7b4ec1 (feat: add lint command placeholder). Both were pushed directly with no linked PR, and neither commit message mentions the missing-definition case.\n- The docs say \"Define only the configurations your project needs\" but do not say what happens when you invoke a tool that has no definition.\n- By contrast, `rs staged` refuses when `define.staged()` is missing (`No define.staged config found`). It is the only command that handles the missing case on purpose.\n\nSo this looks like a default that came with `?? {}` rather than an explicit product decision.\n\n## Question\n\nWhen the matching `define.*` is missing, what should `rs test` / `rs lint` do?\n\n- Keep the current behavior: treat it as `define.test({})` and run. If so, this should be documented, so users know that `rs test` at a monorepo root will pick up nested projects and tests written for other runners.\n- Align with `rs staged`: exit with an error that asks for `define.test()`.\n","author":{"url":"https://github.com/fi3ework","@type":"Person","name":"fi3ework"},"datePublished":"2026-09-15T11:42:20Z","url":"https://github.com/rstackjs/rstack-cli/issues/490"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fffc3b1c-6bd1-a7c1-8f52-e586b6f8d632 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DC6:3F29AB:554C4C:711656:6AEC2A15 |
| html-safe-nonce | 2bb89b6f62a58ed104afd3920d156dc8a07aba74f9639cfb94c9ecb7b4416a5e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REM2OjNGMjlBQjo1NTRDNEM6NzExNjU2OjZBRUMyQTE1IiwidmlzaXRvcl9pZCI6IjY4NzY1MzUxMDQxOTI5MTU5ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 92a685a397983777e1e26a4ab8802a0939a153e76eee13747a6747d9df01951f |
| hovercard-subject-tag | issue:5461433838 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rstackjs/rstack-cli/490/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ba06dc147e84311b822d616d7f498d03f1be7c3ebc8d2810c67839e65bc4fa4a/rstackjs/rstack-cli/issues/490 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ba06dc147e84311b822d616d7f498d03f1be7c3ebc8d2810c67839e65bc4fa4a/rstackjs/rstack-cli/issues/490 |
| og:image:alt | What happens When rstack.config.ts only defines define.lint() and define.fmt() (no define.test()), rs test still starts Rstest with an empty config {}, scans the whole directory with the default in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fi3ework |
| hostname | github.com |
| expected-hostname | github.com |
| None | f290b7f408d9675a032f84ceb13aaf80220f947c681b4c5d9a7560a59ee32f02 |
| turbo-cache-control | no-preview |
| go-import | github.com/rstackjs/rstack-cli git https://github.com/rstackjs/rstack-cli.git |
| octolytics-dimension-user_id | 129049372 |
| octolytics-dimension-user_login | rstackjs |
| octolytics-dimension-repository_id | 1138027854 |
| octolytics-dimension-repository_nwo | rstackjs/rstack-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1138027854 |
| octolytics-dimension-repository_network_root_nwo | rstackjs/rstack-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ad9a37a663eb727a42b8bacc5e035cc3a24dd058 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width