Skip to content

Commit 6da67d1

Browse files
Boshencamc314
andauthored
Release 1.28.0 (#622)
Signed-off-by: Cameron <cameron.clark@hey.com> Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> Co-authored-by: Cameron <cameron.clark@hey.com>
1 parent b457716 commit 6da67d1

File tree

4 files changed

+85
-3
lines changed

4 files changed

+85
-3
lines changed

src/docs/guide/usage/linter/generated-rules.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ search: false
66

77
The progress of all rule implementations is tracked [here](https://github.com/oxc-project/oxc/issues/481).
88

9-
- Total number of rules: 613
9+
- Total number of rules: 614
1010
- Rules turned on by default: 103
1111

1212
**Legend for 'Fixable?' column:**
@@ -489,7 +489,7 @@ Lints which are rather strict or have occasional false positives.
489489
| [prefer-type-error](/docs/guide/usage/linter/rules/unicorn/prefer-type-error.html) | unicorn | | 🛠️ |
490490
| [require-number-to-fixed-digits-argument](/docs/guide/usage/linter/rules/unicorn/require-number-to-fixed-digits-argument.html) | unicorn | | 🛠️ |
491491

492-
## Style (165):
492+
## Style (166):
493493

494494
Code that should be written in a more idiomatic way.
495495

@@ -629,6 +629,7 @@ Code that should be written in a more idiomatic way.
629629
| [no-nested-ternary](/docs/guide/usage/linter/rules/unicorn/no-nested-ternary.html) | unicorn | | 🛠️ |
630630
| [no-null](/docs/guide/usage/linter/rules/unicorn/no-null.html) | unicorn | | 🛠️ |
631631
| [no-unreadable-array-destructuring](/docs/guide/usage/linter/rules/unicorn/no-unreadable-array-destructuring.html) | unicorn | | |
632+
| [no-useless-collection-argument](/docs/guide/usage/linter/rules/unicorn/no-useless-collection-argument.html) | unicorn | | 🚧 |
632633
| [no-zero-fractions](/docs/guide/usage/linter/rules/unicorn/no-zero-fractions.html) | unicorn | | 🛠️ |
633634
| [number-literal-case](/docs/guide/usage/linter/rules/unicorn/number-literal-case.html) | unicorn | | 🛠️ |
634635
| [numeric-separators-style](/docs/guide/usage/linter/rules/unicorn/numeric-separators-style.html) | unicorn | | 🛠️ |

src/docs/guide/usage/linter/rules/node/no-process-env.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ if (config.env === "development") {
4141

4242
## Configuration
4343

44+
This rule accepts a configuration object with the following properties:
45+
4446
### allowedVariables
4547

4648
type: `string[]`
4749

50+
default: `[]`
51+
52+
Variable names which are allowed to be accessed on `process.env`.
53+
4854
## How to use
4955

5056
To **enable** this rule in the CLI or using the config file, you can use:
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!-- This file is auto-generated by tasks/website/src/linter/rules/doc_page.rs. Do not edit it manually. -->
2+
3+
<script setup>
4+
import { data } from '../version.data.js';
5+
const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_linter/src/rules/unicorn/no_useless_collection_argument.rs`;
6+
</script>
7+
8+
# unicorn/no-useless-collection-argument <Badge type="info" text="Style" />
9+
10+
<div class="rule-meta">
11+
<Alert class="fix" type="info">
12+
<span class="emoji">🚧</span> An auto-fix is still under development.
13+
</Alert>
14+
</div>
15+
16+
### What it does
17+
18+
Disallow useless values or fallbacks in Set, Map, WeakSet, or WeakMap
19+
20+
### Why is this bad?
21+
22+
It's unnecessary to pass an empty array or string when constructing a Set, Map, WeakSet, or WeakMap, since they accept nullish values.
23+
It's also unnecessary to provide a fallback for possible nullish values.
24+
25+
### Examples
26+
27+
Examples of **incorrect** code for this rule:
28+
29+
```js
30+
const set = new Set([]);
31+
const set = new Set("");
32+
```
33+
34+
Examples of **correct** code for this rule:
35+
36+
```js
37+
const set = new Set();
38+
```
39+
40+
Examples of **incorrect** code for this rule:
41+
42+
```js
43+
const set = new Set(foo ?? []);
44+
const set = new Set(foo ?? "");
45+
```
46+
47+
Examples of **correct** code for this rule:
48+
49+
```js
50+
const set = new Set(foo);
51+
```
52+
53+
## How to use
54+
55+
To **enable** this rule in the CLI or using the config file, you can use:
56+
57+
::: code-group
58+
59+
```bash [CLI]
60+
oxlint --deny unicorn/no-useless-collection-argument
61+
```
62+
63+
```json [Config (.oxlintrc.json)]
64+
{
65+
"rules": {
66+
"unicorn/no-useless-collection-argument": "error"
67+
}
68+
}
69+
```
70+
71+
:::
72+
73+
## References
74+
75+
- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>
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 "32510006dd5be07faf8423035c5be43382c373a3";
3+
return "78c38978b7b8137d7910e8679815bc32e008b4f5";
44
},
55
};

0 commit comments

Comments
 (0)