Skip to content

Commit 3fc3db6

Browse files
committed
refactor(lint): move useValidTypeof, noNamespaceImport, useNumericLiterals
1 parent 73980d6 commit 3fc3db6

File tree

38 files changed

+366
-390
lines changed

38 files changed

+366
-390
lines changed

.changeset/rule-promotion.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
"@biomejs/biome": major
33
---
44

5-
Promote nursery rules and update the recommended rule set.
5+
Change the group of some rules, promote nursery rules and update the recommended rule set.
6+
7+
The following rules have been moved to a new group:
8+
9+
- [complexity/noFlatMapIdentity](https://biomejs.dev/linter/rules/no-flat-map-identity)
10+
- [complexity/useNumericLiterals](https://biomejs.dev/linter/rules/use-numeric-literals)
11+
- [correctness/useValidTypeof](https://biomejs.dev/linter/rules/use-valid-typeof)
12+
- [performance/noNamespaceImport](https://biomejs.dev/linter/rules/no-namespace-import/)
13+
- [style/useArrayLiterals](https://biomejs.dev/linter/rules/use-array-literals)
14+
- [suspicious/noWith](https://biomejs.dev/linter/rules/no-with)
615

716
New rules are incubated in the nursery group.
817
Once stable, we promote them to a stable group.
@@ -60,12 +69,6 @@ The following JavaScript rules have been promoted:
6069
- [suspicious/useGuardForIn](https://biomejs.dev/linter/rules/use-guard-for-in)
6170
- [suspicious/useStrictMode](https://biomejs.dev/linter/rules/use-strict-mode)
6271

63-
The following rules have been moved to another group:
64-
65-
- [noFlatMapIdentity](https://biomejs.dev/linter/rules/no-flat-map-identity) is now in the `complexity` group
66-
- [noWith](https://biomejs.dev/linter/rules/no-with) is now in the `suspicious` group
67-
- [useArrayLiterals](https://biomejs.dev/linter/rules/use-array-literals) is now in the `style` group
68-
6972
Moreover, the following JavaScript rules are now recommended:
7073

7174
- [complexity/noUselessUndefinedInitialization](https://biomejs.dev/linter/rules/no-useless-undefined-initialization)

benchmark/biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"noVoid": "error",
2727
"useArrowFunction": "error",
2828
"useLiteralKeys": "error",
29+
"useNumericLiterals": "error",
2930
"useRegexLiterals": "error"
3031
},
3132
"correctness": {
@@ -53,6 +54,7 @@
5354
"noUnusedVariables": "error",
5455
"useIsNan": "error",
5556
"useValidForDirection": "error",
57+
"useValidTypeof": "error",
5658
"useYield": "error"
5759
},
5860
"security": {
@@ -67,7 +69,6 @@
6769
"useCollapsedElseIf": "error",
6870
"useDefaultParameterLast": "error",
6971
"useExponentiationOperator": "error",
70-
"useNumericLiterals": "error",
7172
"useSingleVarDeclarator": "error",
7273
"useTemplate": "error"
7374
},
@@ -102,7 +103,6 @@
102103
"useAwait": "error",
103104
"useDefaultSwitchClauseLast": "error",
104105
"useGetterReturn": "error",
105-
"useValidTypeof": "error",
106106
"noVar": "error"
107107
}
108108
}

benchmark/ts-biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"noVoid": "error",
1616
"noWith": "error",
1717
"useArrowFunction": "error",
18+
"useNumericLiterals": "error",
1819
"useRegexLiterals": "error"
1920
},
2021
"correctness": {
@@ -68,7 +69,6 @@
6869
"useExponentiationOperator": "error",
6970
"useForOf": "error",
7071
"useLiteralEnumMembers": "error",
71-
"useNumericLiterals": "error",
7272
"useShorthandFunctionType": "error",
7373
"useSingleVarDeclarator": "error",
7474
"useTemplate": "error"

biome.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,16 @@
4848
"enabled": true,
4949
"rules": {
5050
"style": {
51-
"noNonNullAssertion": "off",
52-
"useNodejsImportProtocol": "error",
53-
"useLiteralEnumMembers": "error",
54-
"noArguments": "error",
5551
"noParameterAssign": "error",
56-
"useShorthandFunctionType": "error",
57-
"useExportType": "error",
5852
"useDefaultParameterLast": "error",
59-
"noCommaOperator": "error",
6053
"useSingleVarDeclarator": "error",
6154
"useConst": "error",
6255
"noInferrableTypes": "error",
63-
"useExponentiationOperator": "error",
6456
"noUselessElse": "error",
6557
"useSelfClosingElements": "error",
66-
"useImportType": "error",
6758
"useNumberNamespace": "error",
6859
"useAsConstAssertion": "error",
6960
"noUnusedTemplateLiteral": "error",
70-
"useNumericLiterals": "error",
7161
"useTemplate": "error",
7262
"useEnumInitializers": "error"
7363
},

crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/biome_cli/tests/snapshots/main_cases_migrate_v2/should_migrate_issue_5465.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ expression: redactor(content)
1313
"noDebugger": "error",
1414
"noShadowRestrictedNames": "off",
1515
"noExplicitAny": "off",
16-
"useValidTypeof": "error",
1716
"noAsyncPromiseExecutor": "off",
1817
"noEmptyInterface": "error",
1918
"noAssignInExpressions": "error",
@@ -53,7 +52,8 @@ expression: redactor(content)
5352
"noUnreachable": "error",
5453
"noUnsafeFinally": "error",
5554
"noSwitchDeclarations": "off",
56-
"noSelfAssign": "off"
55+
"noSelfAssign": "off",
56+
"useValidTypeof": "error"
5757
}
5858
}
5959
}

crates/biome_cli/tests/snapshots/main_commands_lint/linter_shows_the_default_severity_of_rule_on.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ biome.json:5:17 deserialize ━━━━━━━━━━━━━━━━━
6262
- noImplicitBoolean
6363
- noInferrableTypes
6464
- noNamespace
65-
- noNamespaceImport
6665
- noNegationElse
6766
- noNestedTernary
6867
- noNonNullAssertion
@@ -106,7 +105,6 @@ biome.json:5:17 deserialize ━━━━━━━━━━━━━━━━━
106105
- useNodeAssertStrict
107106
- useNodejsImportProtocol
108107
- useNumberNamespace
109-
- useNumericLiterals
110108
- useSelfClosingElements
111109
- useShorthandAssign
112110
- useShorthandFunctionType

crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Linter:
9191
complexity/useDateNow
9292
complexity/useFlatMap
9393
complexity/useLiteralKeys
94+
complexity/useNumericLiterals
9495
complexity/useOptionalChain
9596
complexity/useRegexLiterals
9697
complexity/useSimpleNumberKeys

crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ biome.json:6:13 deserialize ━━━━━━━━━━━━━━━━━
101101
- useIsNan
102102
- useJsxKeyInIterable
103103
- useValidForDirection
104+
- useValidTypeof
104105
- useYield
105106
106107
@@ -133,7 +134,6 @@ biome.json:9:13 deserialize ━━━━━━━━━━━━━━━━━
133134
- noImplicitBoolean
134135
- noInferrableTypes
135136
- noNamespace
136-
- noNamespaceImport
137137
- noNegationElse
138138
- noNestedTernary
139139
- noNonNullAssertion
@@ -177,7 +177,6 @@ biome.json:9:13 deserialize ━━━━━━━━━━━━━━━━━
177177
- useNodeAssertStrict
178178
- useNodejsImportProtocol
179179
- useNumberNamespace
180-
- useNumericLiterals
181180
- useSelfClosingElements
182181
- useShorthandAssign
183182
- useShorthandFunctionType

0 commit comments

Comments
 (0)