Skip to content

Commit fe0f0e3

Browse files
authored
Release 0.18.0 (#389)
1 parent 2b669ce commit fe0f0e3

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

src/docs/guide/usage/linter/rules/eslint/func-style.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ type: `boolean`
150150

151151
default: `false`
152152

153+
### allowTypeAnnotation
154+
155+
type: `boolean`
156+
157+
default: `false`
158+
153159
### style
154160

155161
type: `"expression" | "declaration"`

src/docs/guide/usage/linter/rules/typescript/no-unsafe-declaration-merging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Disallow unsafe declaration merging.
2020
### Why is this bad?
2121

2222
Declaration merging between classes and interfaces is unsafe.
23-
The TypeScript compiler doesn't check whether properties are initialized, which can cause lead to TypeScript not detecting code that will cause runtime errors.
23+
The TypeScript compiler doesn't check whether properties are initialized, which can lead to TypeScript not detecting code that will cause runtime errors.
2424

2525
### Examples
2626

src/docs/guide/usage/linter/rules/unicorn/switch-case-braces.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,21 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin
1515

1616
### What it does
1717

18-
Require empty switch cases to not have braces. Non-empty braces are required to have braces around them.
18+
Requires empty switch cases to omit braces, while non-empty cases must use braces.
19+
This reduces visual clutter for empty cases and enforces proper scoping for non-empty ones.
1920

2021
### Why is this bad?
2122

22-
There is less visual clutter for empty cases and proper scope for non-empty cases.
23+
Using braces unnecessarily for empty cases adds visual noise,
24+
while omitting braces in non-empty cases can lead to scoping issues.
2325

2426
### Examples
2527

2628
Examples of **incorrect** code for this rule:
2729

2830
```javascript
2931
switch (num) {
30-
case 1: {
31-
}
32+
case 1: {}
3233
case 2:
3334
console.log("Case 2");
3435
break;
@@ -39,15 +40,30 @@ Examples of **correct** code for this rule:
3940

4041
```javascript
4142
switch (num) {
42-
case 1: {
43-
}
43+
case 1:
4444
case 2: {
4545
console.log("Case 2");
4646
break;
4747
}
4848
}
4949
```
5050

51+
### Options
52+
53+
`{ type: "always" | "avoid", default: "always" }`
54+
55+
- `"always"`
56+
Always report when clause is not a `BlockStatement`.
57+
58+
- `"avoid"`
59+
Allows braces only when needed for scoping (e.g., variable or function declarations).
60+
61+
Example:
62+
63+
```json
64+
"unicorn/switch-case-braces": ["error", "avoid"]
65+
```
66+
5167
## How to use
5268

5369
To **enable** this rule in the CLI or using the config file, you can use:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default {
22
load() {
3-
return "49b664c6b9e5eb8b9c177f9fab1b8372763359e0";
3+
return "1a71d7c16f27c7f52f1bd1f5823a15f1f8123693";
44
},
55
};

0 commit comments

Comments
 (0)