Skip to content

Commit 2ce92bf

Browse files
committed
Merge remote-tracking branch 'origin/main' into isolated-functions
2 parents 6715b87 + 2dc27d9 commit 2ce92bf

File tree

913 files changed

+60221
-17473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

913 files changed

+60221
-17473
lines changed

.eslint-doc-generatorrc.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22

33
/** @type {import('eslint-doc-generator').GenerateOptions} */
44
const config = {
5-
ignoreConfig: ['all'],
6-
ignoreDeprecatedRules: true,
7-
ruleDocTitleFormat: 'desc',
8-
ruleListColumns: [
9-
'name',
10-
'description',
11-
'configsError',
12-
// Omit `configsOff` since we don't intend to convey meaning by setting rules to `off` in the `recommended` config.
13-
'configsWarn',
14-
'fixable',
15-
'hasSuggestions',
16-
'requiresTypeChecking',
17-
],
18-
urlConfigs: 'https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs',
5+
ignoreConfig: [
6+
'all',
7+
'flat/all',
8+
'flat/recommended',
9+
],
10+
ignoreDeprecatedRules: true,
11+
ruleDocTitleFormat: 'desc',
12+
ruleListColumns: [
13+
'name',
14+
'description',
15+
'configsError',
16+
// Omit `configsOff` since we don't intend to convey meaning by setting rules to `off` in the `recommended` config.
17+
'configsWarn',
18+
'fixable',
19+
'hasSuggestions',
20+
'requiresTypeChecking',
21+
],
22+
urlConfigs: 'https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config',
1923
};
2024

21-
module.exports = config;
25+
export default config;

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: Bug report
33
about: A rule isn't working as it should?
4+
labels: bug
45
---
56

67
<!-- ✨ Thanks for reporting a bug! ➡️ Please don't ignore this template -->
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Rule change
2+
description: A rule could be improved or extended?
3+
title: "`rule-name`: "
4+
labels:
5+
- change request
6+
- evaluating
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Before opening a new issue:
12+
- Look for existing [open or closed rule proposals](https://github.com/sindresorhus/eslint-plugin-unicorn/issues?q=is:issue+label%25enhancement)
13+
- [Report a bug](https://github.com/sindresorhus/eslint-plugin-unicorn/issues/new?assignees=&labels=&projects=&template=bug_report.md) instead if it's a false positive
14+
- type: textarea
15+
validations:
16+
required: true
17+
attributes:
18+
label: Description
19+
description: Explain the improvement you would like to see.
20+
- type: textarea
21+
validations:
22+
required: true
23+
attributes:
24+
label: Examples
25+
description: Provide examples of code to detect and the acceptable alternatives.
26+
value: |
27+
```js
28+
// ❌
29+
var replace = 'me';
30+
31+
// ✅
32+
const replace = 'me';
33+
```
34+
35+
```js
36+
// ❌
37+
function foo() {
38+
var replace = 'me';
39+
return replace;
40+
}
41+
42+
// ✅
43+
function foo() {
44+
return 'me';
45+
}
46+
```
47+
- type: textarea
48+
attributes:
49+
label: Additional Info

.github/ISSUE_TEMPLATE/rule_proposal.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@ body:
2020
validations:
2121
required: true
2222
attributes:
23-
label: Fail
24-
description: Specify examples of code that should be detected
23+
label: Examples
24+
description: Provide examples of code to detect and the acceptable alternatives.
2525
value: |
2626
```js
27+
// ❌
2728
var replace = 'me';
29+
30+
// ✅
31+
const replace = 'me';
2832
```
2933
3034
```js
35+
// ❌
3136
function foo() {
32-
var replace = 'me';
33-
return replace;
37+
var replace = 'me';
38+
return replace;
3439
}
35-
```
36-
- type: textarea
37-
validations:
38-
required: true
39-
attributes:
40-
label: Pass
41-
description: Specify examples of code that would be accepted in its place
42-
value: |
43-
```js
44-
const replace = 'me';
45-
```
4640
47-
```js
41+
// ✅
4842
function foo() {
49-
return 'me';
43+
return 'me';
5044
}
5145
```
46+
- type: input
47+
validations:
48+
required: true
49+
attributes:
50+
label: Proposed rule name
51+
placeholder: no-invalid-rule-name
5252
- type: textarea
5353
attributes:
5454
label: Additional Info

.github/contributing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ First open an issue with your proposal. When the rule is accepted, see the [docs
1111
## I want to implement a rule from an open issue
1212

1313
See the [docs on creating and submitting a new rule](../docs/new-rule.md).
14+
15+
## How to write tests
16+
17+
See the [docs on writing tests](../docs/write-tests.md).

.github/funding.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github: [sindresorhus, fisker]
2+
open_collective: sindresorhus
3+
buy_me_a_coffee: sindresorhus
4+
custom: https://sindresorhus.com/donate

.github/workflows/main.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,54 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
node-version:
18+
- 24
1819
- 20
19-
- 16
2020
os:
2121
- ubuntu-latest
2222
- windows-latest
23+
# Even numbers of node-version
2324
include:
2425
- os: ubuntu-latest
25-
node-version: 18
26+
node-version: 22
2627
steps:
27-
- uses: actions/checkout@v3
28-
- uses: actions/setup-node@v3
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
2930
with:
3031
node-version: ${{ matrix.node-version }}
3132
- run: npm install
3233
- run: npx ava
3334
lint-test:
34-
runs-on: ubuntu-latest
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
matrix:
38+
os:
39+
- ubuntu-latest
40+
- windows-latest
3541
steps:
36-
- uses: actions/checkout@v3
37-
- uses: actions/setup-node@v3
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-node@v4
44+
with:
45+
# Locked due to the difference of `zlib.gzipSync()` between Node.js versions
46+
node-version: 24
3847
- run: npm install
3948
- run: npm run lint
40-
- run: rm -rf test/snapshots
49+
- run: npx del-cli test/snapshots --verbose
4150
# Force update snapshots, https://github.com/avajs/ava/discussions/2754
4251
- run: npx c8 ava --update-snapshots
4352
env:
4453
AVA_FORCE_CI: not-ci
4554
- run: git diff --exit-code
46-
- uses: codecov/codecov-action@v3
55+
- uses: codecov/codecov-action@v5
4756
with:
4857
fail_ci_if_error: true
58+
disable_search: true
4959
files: coverage/lcov.info
60+
token: ${{ secrets.CODECOV_TOKEN }}
5061
run-rules-on-codebase:
5162
runs-on: ubuntu-latest
5263
steps:
53-
- uses: actions/checkout@v3
54-
- uses: actions/setup-node@v3
64+
- uses: actions/checkout@v4
65+
- uses: actions/setup-node@v4
5566
- run: npm install
5667
- run: npm run run-rules-on-codebase
5768
integration:
@@ -69,15 +80,11 @@ jobs:
6980
- "7"
7081
- "8"
7182
- "9"
72-
- "10"
73-
- "11"
74-
- "12"
75-
- "13"
7683
env:
7784
TIMING: 1
7885
runs-on: ubuntu-latest
7986
steps:
80-
- uses: actions/checkout@v3
81-
- uses: actions/setup-node@v3
87+
- uses: actions/checkout@v4
88+
- uses: actions/setup-node@v4
8289
- run: npm install
8390
- run: npm run integration -- --group ${{ matrix.group }}

.github/workflows/smoke-test.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ jobs:
99
lint:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-node@v3
14-
- run: |
15-
npm install
16-
npm link
17-
npm link eslint-plugin-unicorn
18-
- uses: AriPerkkio/eslint-remote-tester-run-action@v4
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
- run: npm install
15+
- uses: AriPerkkio/eslint-remote-tester-run-action@v5
1916
with:
2017
issue-title: "Results of weekly scheduled smoke test"
2118
eslint-remote-tester-config: test/smoke/eslint-remote-tester.config.js

.github/workflows/title-formatter.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Title formatter
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited]
6+
issues:
7+
types: [opened, edited]
8+
9+
jobs:
10+
Rule:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
issues: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
sparse-checkout: docs/rules
19+
- name: Auto-format rule names in titles
20+
uses: fregante/keyword-formatter-action@v1
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
keywords-path: docs/rules
24+
prefix: unicorn/
25+

.markdownlint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"no-hard-tabs": false,
55
"ul-style": {
66
"style": "dash"
7-
}
7+
},
8+
"descriptive-link-text": false
89
}

0 commit comments

Comments
 (0)