Skip to content

Commit 18c77d6

Browse files
authored
Release 0.18.1 (#392)
1 parent d4fab89 commit 18c77d6

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

src/docs/guide/usage/linter/rules/eslint/no-magic-numbers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_lin
1515

1616
### What it does
1717

18-
The no-magic-numbers rule aims to make code more readable and refactoring easier by ensuring that special numbers are declared as constants to make their meaning explicit.
18+
This rule aims to make code more readable and refactoring easier by ensuring that special numbers are declared as constants to make their meaning explicit.
1919
The current implementation does not support BigInt numbers inside array indexes.
2020

2121
### Why is this bad?

src/docs/guide/usage/linter/rules/eslint/no-undefined.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ Disallow the use of `undefined` as an identifier
1616

1717
### Why is this bad?
1818

19-
### Example of bad code
19+
Using undefined directly can lead to bugs, since it can be shadowed or overwritten in JavaScript.
20+
It's safer and more intentional to use null or rely on implicit undefined (e.g., missing return) to avoid accidental issues.
21+
22+
### Examples
23+
24+
Examples of **incorrect** code for this rule:
2025

2126
```javascript
2227
var foo = undefined;
@@ -34,7 +39,7 @@ function baz(undefined) {
3439
bar(undefined, "lorem");
3540
```
3641

37-
### Example of good code
42+
Examples of **correct** code for this rule:
3843

3944
```javascript
4045
var foo = void 0;

src/docs/guide/usage/linter/rules/eslint/valid-typeof.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ typeof bar !== "fucntion"; // spellchecker:disable-line
4040

4141
Examples of **correct** code for this rule:
4242

43-
````js
44-
typeof foo === "string"
45-
typeof bar == "undefined"
46-
typeof foo === baz
47-
typeof bar === typeof qux
4843
```js
44+
typeof foo === "string";
45+
typeof bar == "undefined";
46+
typeof foo === baz;
47+
typeof bar === typeof qux;
48+
```
4949

5050
### Options
5151

@@ -58,14 +58,15 @@ expressions with only string literals or other `typeof` expressions, and disallo
5858
comparisons to any other value. Default is `false`.
5959

6060
With `requireStringLiterals` set to `true` the following are examples of incorrect code:
61+
6162
```js
62-
typeof foo === undefined
63-
typeof bar == Object
64-
typeof baz === "strnig"
65-
typeof qux === "some invalid type"
66-
typeof baz === anotherVariable
67-
typeof foo == 5
68-
````
63+
typeof foo === undefined;
64+
typeof bar == Object;
65+
typeof baz === "strnig";
66+
typeof qux === "some invalid type";
67+
typeof baz === anotherVariable;
68+
typeof foo == 5;
69+
```
6970

7071
With `requireStringLiterals` set to `true` the following are examples of correct code:
7172

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 "1a71d7c16f27c7f52f1bd1f5823a15f1f8123693";
3+
return "df7dc74cc90fa27efccf9a988c0f82e883a42302";
44
},
55
};

0 commit comments

Comments
 (0)