+
+ i Consider using
from next/image to automatically optimize images.
+
+ i This may incur additional usage or cost from your provider.
+
+
+```
+
+```
+invalid.jsx:5:3 lint/nursery/noImgElement ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ! Using
could result in slower LCP and higher bandwidth.
+
+ 4 │
+ > 5 │
+ │ ^^^^^^^^^^^^^^^^^
+ 6 │
+ 7 │ >
+
+ i Consider using
from next/image to automatically optimize images.
+
+ i This may incur additional usage or cost from your provider.
+
+
+```
diff --git a/crates/biome_js_analyze/tests/specs/nursery/noImgElement/valid.jsx b/crates/biome_js_analyze/tests/specs/nursery/noImgElement/valid.jsx
new file mode 100644
index 000000000000..f47d1e4ada55
--- /dev/null
+++ b/crates/biome_js_analyze/tests/specs/nursery/noImgElement/valid.jsx
@@ -0,0 +1,7 @@
+<>
+
+
+
+>
diff --git a/crates/biome_js_analyze/tests/specs/nursery/noImgElement/valid.jsx.snap b/crates/biome_js_analyze/tests/specs/nursery/noImgElement/valid.jsx.snap
new file mode 100644
index 000000000000..2fb934209539
--- /dev/null
+++ b/crates/biome_js_analyze/tests/specs/nursery/noImgElement/valid.jsx.snap
@@ -0,0 +1,16 @@
+---
+source: crates/biome_js_analyze/tests/spec_tests.rs
+assertion_line: 86
+expression: valid.jsx
+---
+# Input
+```jsx
+<>
+
+
+
+>
+
+```
diff --git a/packages/@biomejs/backend-jsonrpc/src/workspace.ts b/packages/@biomejs/backend-jsonrpc/src/workspace.ts
index 98ac3194ef66..5f7d48fdcc6c 100644
--- a/packages/@biomejs/backend-jsonrpc/src/workspace.ts
+++ b/packages/@biomejs/backend-jsonrpc/src/workspace.ts
@@ -1254,6 +1254,10 @@ export interface Nursery {
* Prevent usage of \ element in a Next.js project.
*/
noHeadElement?: RuleConfiguration_for_Null;
+ /**
+ * Prevent usage of \
element in a Next.js project.
+ */
+ noImgElement?: RuleConfiguration_for_Null;
/**
* Disallows the use of irregular whitespace characters.
*/
@@ -2858,6 +2862,7 @@ export type Category =
| "lint/nursery/noDynamicNamespaceImportAccess"
| "lint/nursery/noEnum"
| "lint/nursery/noExportedImports"
+ | "lint/nursery/noImgElement"
| "lint/nursery/noImportantInKeyframe"
| "lint/nursery/noInvalidDirectionInLinearGradient"
| "lint/nursery/noInvalidGridAreas"
diff --git a/packages/@biomejs/biome/configuration_schema.json b/packages/@biomejs/biome/configuration_schema.json
index 0fc294995c75..5d47964d280e 100644
--- a/packages/@biomejs/biome/configuration_schema.json
+++ b/packages/@biomejs/biome/configuration_schema.json
@@ -2130,6 +2130,13 @@
{ "type": "null" }
]
},
+ "noImgElement": {
+ "description": "Prevent usage of \\
element in a Next.js project.",
+ "anyOf": [
+ { "$ref": "#/definitions/RuleConfiguration" },
+ { "type": "null" }
+ ]
+ },
"noIrregularWhitespace": {
"description": "Disallows the use of irregular whitespace characters.",
"anyOf": [