Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/large-lands-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@biomejs/biome": minor
---

Promoted new lint rules:
- Promoted `noNonNullAssertedOptionalChain` to the suspicious group
- Promoted `useReactFunctionComponents` to the `style` group
- Promoted `useImageSize` to the `correctness` group
- Promoted `useConsistentTypeDefinitions` to the `style` group
- Promoted `useQwikClasslist` to the `correctness` group
- Promoted `noSecrets` to the `security` group

Removed the lint rule `useAnchorHref`, because its use case is covered by `useValidAnchor`.
4 changes: 2 additions & 2 deletions crates/biome_analyze/src/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub enum RuleSource {
EslintN(&'static str),
/// Rules from [Eslint Plugin Next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next)
EslintNext(&'static str),
/// Rules from [Eslint Plugin Qwik](https://github.com/BuilderIO/eslint-plugin-qwik)
/// Rules from [Eslint Plugin Qwik](https://github.com/QwikDev/qwik)
EslintQwik(&'static str),
/// Rules from [Stylelint](https://github.com/stylelint/stylelint)
Stylelint(&'static str),
Expand Down Expand Up @@ -370,7 +370,7 @@ impl RuleSource {
Self::EslintBarrelFiles(rule_name) => format!("https://github.com/thepassle/eslint-plugin-barrel-files/blob/main/docs/rules/{rule_name}.md"),
Self::EslintN(rule_name) => format!("https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/{rule_name}.md"),
Self::EslintNext(rule_name) => format!("https://nextjs.org/docs/messages/{rule_name}"),
Self::EslintQwik(rule_name) => format!("https://github.com/BuilderIO/eslint-plugin-qwik/blob/main/docs/rules/{rule_name}.md"),
Self::EslintQwik(rule_name) => format!("https://qwik.dev/docs/advanced/eslint/#{rule_name}"),
Self::Stylelint(rule_name) => format!("https://github.com/stylelint/stylelint/blob/main/lib/rules/{rule_name}/README.md"),
Self::EslintNoSecrets(_) => "https://github.com/nickdeis/eslint-plugin-no-secrets/blob/master/README.md".to_string(),
Self::EslintRegexp(rule_name) => format!("https://ota-meshi.github.io/eslint-plugin-regexp/rules/{rule_name}.html"),
Expand Down
50 changes: 9 additions & 41 deletions crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/biome_cli/tests/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,7 @@ fn applies_custom_bracket_spacing_for_graphql() {
}

#[test]
fn html_enabled_by_default() {
fn html_disabled_by_default() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

Expand All @@ -3433,7 +3433,7 @@ fn html_enabled_by_default() {

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"html_enabled_by_default",
"html_disabled_by_default",
fs,
console,
result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test1.js:1:10 lint/suspicious/noFocusedTests FIXABLE ━━━━━━━━
```block
test2.js:4:5 lint/suspicious/noDuplicateTestHooks ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Disallow duplicate setup and teardown hooks.
× The test hook beforeEach is used multiple times in the same test block.

2 │ describe("foo", () => {
3 │ beforeEach(() => {});
Expand All @@ -83,7 +83,7 @@ test2.js:4:5 lint/suspicious/noDuplicateTestHooks ━━━━━━━━━━
5 │ test("bar", () => {
6 │ someFn();

i Disallow beforeEach duplicacy inside the describe function.
i The presence of the same hook more than once in the same test block can create unexpected errors inside tests. Remove one of them.


```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
---
## `file.html`

```html
<!DOCTYPE HTML>
```

# Termination Message

```block
format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× No files were processed in the specified paths.

i Check your biome.json or biome.jsonc to ensure the paths are not ignored by the configuration.

i These paths were provided but ignored:

- file.html



```

# Emitted Messages

```block
Formatted 0 files in <TIME>. No fixes applied.
```
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ biome.json:5:17 deserialize ━━━━━━━━━━━━━━━━━
- useConsistentCurlyBraces
- useConsistentMemberAccessibility
- useConsistentObjectDefinitions
- useConsistentTypeDefinitions
- useConst
- useDefaultParameterLast
- useDefaultSwitchClause
Expand All @@ -110,6 +111,7 @@ biome.json:5:17 deserialize ━━━━━━━━━━━━━━━━━
- useNumberNamespace
- useNumericSeparators
- useObjectSpread
- useReactFunctionComponents
- useReadonlyClassProperties
- useSelfClosingElements
- useShorthandAssign
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ biome.json:6:13 deserialize ━━━━━━━━━━━━━━━━━
- noPrecisionLoss
- noPrivateImports
- noProcessGlobal
- noQwikUseVisibleTask
- noReactPropAssignments
- noRenderReturnValue
- noRestrictedElements
Expand Down Expand Up @@ -103,11 +104,13 @@ biome.json:6:13 deserialize ━━━━━━━━━━━━━━━━━
- useExhaustiveDependencies
- useGraphqlNamedOperations
- useHookAtTopLevel
- useImageSize
- useImportExtensions
- useIsNan
- useJsonImportAttributes
- useJsxKeyInIterable
- useParseIntRadix
- useQwikClasslist
- useSingleJsDocAsterisk
- useUniqueElementIds
- useValidForDirection
Expand Down Expand Up @@ -170,6 +173,7 @@ biome.json:9:13 deserialize ━━━━━━━━━━━━━━━━━
- useConsistentCurlyBraces
- useConsistentMemberAccessibility
- useConsistentObjectDefinitions
- useConsistentTypeDefinitions
- useConst
- useDefaultParameterLast
- useDefaultSwitchClause
Expand All @@ -192,6 +196,7 @@ biome.json:9:13 deserialize ━━━━━━━━━━━━━━━━━
- useNumberNamespace
- useNumericSeparators
- useObjectSpread
- useReactFunctionComponents
- useReadonlyClassProperties
- useSelfClosingElements
- useShorthandAssign
Expand Down
869 changes: 424 additions & 445 deletions crates/biome_configuration/src/analyzer/linter/rules.rs

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions crates/biome_configuration/src/generated/domain_selector.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ impl Rule for NoEmptySource {
return None;
}

if ctx.options().allow_comments && node.syntax().has_comments_direct() {
if ctx.options().allow_comments
&& (node.syntax().has_comments_direct()
|| node.eof_token().ok()?.has_leading_comments())
{
return None;
}

Expand Down
Loading
Loading