Biome's linter has a total of 211 rules
\ No newline at end of file +
Biome's linter has a total of 212 rules
\ No newline at end of file
diff --git a/website/src/content/docs/linter/rules/index.mdx b/website/src/content/docs/linter/rules/index.mdx
index 2254670420ba..f8514cd4b3f3 100644
--- a/website/src/content/docs/linter/rules/index.mdx
+++ b/website/src/content/docs/linter/rules/index.mdx
@@ -261,6 +261,7 @@ Rules that belong to this group are not subject to semantic versiondescribe() in test files. | |
| [noExportsInTest](/linter/rules/no-exports-in-test) | Disallow using export
or module.exports
in files containing tests | |
| [noFocusedTests](/linter/rules/no-focused-tests) | Disallow focused tests. | ⚠️ |
+| [noMisplacedAssertion](/linter/rules/no-misplaced-assertion) | Checks that the assertion function, for example expect
, is placed inside an it()
function call. | |
| [noNamespaceImport](/linter/rules/no-namespace-import) | Disallow the use of namespace imports. | |
| [noNodejsModules](/linter/rules/no-nodejs-modules) | Forbid the use of Node.js builtin modules. | |
| [noReExportAll](/linter/rules/no-re-export-all) | Avoid re-export all. | |
diff --git a/website/src/content/docs/linter/rules/no-misplaced-assertion.md b/website/src/content/docs/linter/rules/no-misplaced-assertion.md
new file mode 100644
index 000000000000..1784d716e7ef
--- /dev/null
+++ b/website/src/content/docs/linter/rules/no-misplaced-assertion.md
@@ -0,0 +1,156 @@
+---
+title: noMisplacedAssertion (not released)
+---
+
+**Diagnostic Category: `lint/nursery/noMisplacedAssertion`**
+
+:::danger
+This rule hasn't been released yet.
+:::
+
+:::caution
+This rule is part of the [nursery](/linter/rules/#nursery) group.
+:::
+
+Inspired from: no-standalone-expect
+
+Checks that the assertion function, for example `expect`, is placed inside an `it()` function call.
+
+Placing (and using) the `expect` assertion function can result in unexpected behaviors when executing your testing suite.
+
+The rule will check for the following assertion calls:
+
+- `expect`
+- `assert`
+- `assertEquals`
+
+If the assertion function is imported, the rule will check if they are imported from:
+
+- `"chai"`
+- `"node:assert"`
+- `"node:assert/strict"`
+- `"bun:test"`
+- `"vitest"`
+- Deno assertion module URL
+
+Check the [options](#options) if you need to change the defaults.
+
+## Examples
+
+### Invalid
+
+```jsx
+describe("describe", () => {
+ expect()
+})
+```
+
+
+
+```jsx
+import assert from "node:assert";
+describe("describe", () => {
+ assert.equal()
+})
+```
+
+nursery/noMisplacedAssertion.js:2:5 lint/nursery/noMisplacedAssertion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ⚠ The assertion isn't inside a it(), test() or Deno.test() function call.
+
+ 1 │ describe("describe", () => {
+ > 2 │ expect()
+ │ ^^^^^^
+ 3 │ })
+ 4 │
+
+ ℹ This will result in unexpected behaviours from your test suite.
+
+ ℹ Move the assertion inside a it(), test() or Deno.test() function call.
+
+
+
+```jsx
+import {test, expect} from "bun:test";
+expect(1, 2)
+```
+
+nursery/noMisplacedAssertion.js:3:5 lint/nursery/noMisplacedAssertion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ⚠ The assertion isn't inside a it(), test() or Deno.test() function call.
+
+ 1 │ import assert from "node:assert";
+ 2 │ describe("describe", () => {
+ > 3 │ assert.equal()
+ │ ^^^^^^
+ 4 │ })
+ 5 │
+
+ ℹ This will result in unexpected behaviours from your test suite.
+
+ ℹ Move the assertion inside a it(), test() or Deno.test() function call.
+
+
+
+```jsx
+import {assertEquals} from "https://deno.land/std@0.220.0/assert/mod.ts";
+
+assertEquals(url.href, "https://deno.land/foo.js");
+Deno.test("url test", () => {
+ const url = new URL("./foo.js", "https://deno.land/");
+});
+```
+
+nursery/noMisplacedAssertion.js:2:1 lint/nursery/noMisplacedAssertion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ⚠ The assertion isn't inside a it(), test() or Deno.test() function call.
+
+ 1 │ import {test, expect} from "bun:test";
+ > 2 │ expect(1, 2)
+ │ ^^^^^^
+ 3 │
+
+ ℹ This will result in unexpected behaviours from your test suite.
+
+ ℹ Move the assertion inside a it(), test() or Deno.test() function call.
+
+
+
+### Valid
+
+```jsx
+import assert from "node:assert";
+describe("describe", () => {
+ it("it", () => {
+ assert.equal()
+ })
+})
+```
+
+```jsx
+describe("describe", () => {
+ it("it", () => {
+ expect()
+ })
+})
+```
+
+## Related links
+
+- [Disable a rule](/linter/#disable-a-lint-rule)
+- [Rule options](/linter/#rule-options)
diff --git a/website/src/content/docs/linter/rules/use-valid-aria-role.md b/website/src/content/docs/linter/rules/use-valid-aria-role.md
index 314cfe0970ef..83447fc2dab7 100644
--- a/website/src/content/docs/linter/rules/use-valid-aria-role.md
+++ b/website/src/content/docs/linter/rules/use-valid-aria-role.md
@@ -110,7 +110,7 @@ Elements with ARIA roles must use a valid, non-abstract ARIA role.
>
```
-### Options
+## Options
```json
{
nursery/noMisplacedAssertion.js:3:1 lint/nursery/noMisplacedAssertion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ⚠ The assertion isn't inside a it(), test() or Deno.test() function call.
+
+ 1 │ import {assertEquals} from "https://deno.land/std@0.220.0/assert/mod.ts";
+ 2 │
+ > 3 │ assertEquals(url.href, "https://deno.land/foo.js");
+ │ ^^^^^^^^^^^^
+ 4 │ Deno.test("url test", () => {
+ 5 │ const url = new URL("./foo.js", "https://deno.land/");
+
+ ℹ This will result in unexpected behaviours from your test suite.
+
+ ℹ Move the assertion inside a it(), test() or Deno.test() function call.
+
+