Skip to content

Commit 9173842

Browse files
Merge remote-tracking branch 'origin/master' into ensure-matching-remove-event-listener
2 parents 33539a2 + b94cf05 commit 9173842

File tree

143 files changed

+1759
-1068
lines changed

Some content is hidden

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

143 files changed

+1759
-1068
lines changed

.github/workflows/node-4+.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
eslint: 5
9595

9696
steps:
97-
- uses: actions/checkout@v2
97+
- uses: actions/checkout@v3
9898
- uses: ljharb/actions/node/install@main
9999
name: 'nvm install ${{ matrix.node-version }} && npm install'
100100
with:
@@ -107,7 +107,7 @@ jobs:
107107
- run: npx ls-engines
108108
if: ${{ matrix.node-version >= 12 }}
109109
- run: npm run unit-test
110-
- uses: codecov/codecov-action@v1
110+
- uses: codecov/codecov-action@v3
111111

112112
node:
113113
name: 'node 4+'

.github/workflows/node-pretest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
- uses: ljharb/actions/node/install@main
1212
name: 'nvm install lts/* && npm install'
1313
with:
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424
- uses: ljharb/actions/node/install@main
2525
name: 'nvm install lts/* && npm install'
2626
with:

.github/workflows/npm-publish.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Publish Package to npm
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: "Tag to publish"
7+
required: true
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check-version:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
is-new-version: ${{ steps.cpv.outputs.is-new-version }}
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
ref: ${{ github.event.inputs.tag }}
21+
22+
- name: Validate semver pattern
23+
run: npx semver ${{ inputs.tag }}
24+
25+
- name: Check package version
26+
id: cpv
27+
uses: PostHog/check-package-version@v2
28+
29+
- name: Validate package version
30+
uses: actions/github-script@v6
31+
with:
32+
script: |
33+
const isNewVersion = `${{ steps.cpv.outputs.is-new-version }}`;
34+
if (isNewVersion === 'true') {
35+
console.log(`Version ${context.payload.inputs.tag} has not been published yet`);
36+
} else {
37+
core.setFailed(`Version ${context.payload.inputs.tag} is already published`);
38+
}
39+
40+
check-status:
41+
needs: check-version
42+
if: needs.check-version.outputs.is-new-version == 'true'
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Verify checks passed
46+
uses: actions/github-script@v6
47+
with:
48+
result-encoding: string
49+
retries: 3
50+
script: |
51+
const ref = context.payload.inputs.tag;
52+
53+
console.log(`Checking status checks for ${ref}`);
54+
55+
const { owner, repo } = context.repo;
56+
const { default_branch: branch } = context.payload.repository;
57+
58+
const branch = github.rest.repos.getBranch({ owner, repo, branch });
59+
60+
const checkSuites = await github.rest.checks.listSuitesForRef({ owner, repo, ref });
61+
62+
if (checkSuites.some(({ status }) => 'completed')) {
63+
core.setFailed(`Some workflows for ${context.payload.inputs.tag} are still in-progress`);
64+
}
65+
66+
const { data: { check_runs: checkRuns } } = await Promise.all(
67+
(await branch).data.protection.required_status_checks.checks.map(({ context }) => (
68+
github.rest.checks.listForRef({
69+
owner,
70+
repo,
71+
ref,
72+
check_name: context
73+
})
74+
)
75+
)
76+
77+
checkRuns.forEach(({ name, status, conclusion }) => {
78+
if (status !== 'completed' || conclusion !== 'success') {
79+
console.log(`${name} check failed`);
80+
core.setFailed(`Required status check ${name} did not succeed`);
81+
}
82+
console.log(`${name} check passed`);
83+
});
84+
85+
publish:
86+
needs: [check-status]
87+
runs-on: ubuntu-latest
88+
permissions:
89+
contents: read
90+
id-token: write
91+
steps:
92+
- uses: step-security/harden-runner@v1
93+
with:
94+
egress-policy: block
95+
allowed-endpoints: >
96+
github.com:443
97+
nodejs.org:443
98+
prod.api.stepsecurity.io:443
99+
registry.npmjs.org:443
100+
101+
- uses: actions/checkout@v3
102+
with:
103+
ref: ${{ github.event.inputs.tag }}
104+
105+
- uses: ljharb/actions/node/install@main
106+
name: "nvm install lts/* && npm install"
107+
with:
108+
node-version: "lts/*"
109+
env:
110+
NPM_CONFIG_LEGACY_PEER_DEPS: true
111+
112+
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
113+
114+
- run: npm publish --dry-run
115+
116+
- uses: step-security/wait-for-secrets@v1
117+
id: wait-for-secrets
118+
with:
119+
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
120+
secrets: |
121+
OTP:
122+
name: 'OTP to publish package'
123+
description: 'OTP from authenticator app'
124+
125+
- run: npm publish --access public --otp ${{ steps.wait-for-secrets.outputs.OTP }}

.github/workflows/readme.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/rebase.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- uses: ljharb/rebase@master
1414
env:
1515
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
2727
shell: bash
2828

29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
3030

3131
- uses: mindsers/changelog-reader-action@v2
3232
id: changelog_reader

.github/workflows/smoke-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: ${{ github.repository == 'jsx-eslint/eslint-plugin-react' || github.event_name == 'workflow_dispatch' }}
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- uses: ljharb/actions/node/install@main
1515
name: 'nvm install lts/* && npm install'
1616
with:

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,27 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
99
* support new config system ([#3429][] @jjangga0214)
1010
* [`hook-use-state`]: add `allowDestructuredState` option ([#3449][] @ljharb)
1111
* add [`sort-default-props`] and deprecate [`jsx-sort-default-props`] ([#1861][] @alexzherdev)
12+
* add [`no-object-type-as-default-prop`] rule ([#2848][] @cyan33 @fengkx)
1213

14+
### Fixed
15+
* configs: avoid legacy config system error ([#3461][] @ljharb)
16+
* [`jsx-no-target-blank`]: allow ternaries with literals ([#3464][] @akulsr0)
17+
* [`sort-prop-types`]: restore autofixing ([#2574][] @ROSSROSALES)
18+
19+
### Changed
20+
* [Perf] component detection: improve performance by avoiding traversing parents unnecessarily ([#3459][] @golopot)
21+
* [Docs] `forbid-component-props`: inclusive language w/ allowlist ([#3473][] @AndersDJohnson)
22+
* [Docs] automate doc generation with `eslint-doc-generator` ([#3469][] @bmish)
23+
24+
[#3473]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3473
25+
[#3469]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3469
26+
[#3464]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3464
27+
[#3461]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3461
28+
[#3459]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3459
29+
[#3452]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3452
1330
[#3449]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3449
1431
[#3424]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3429
32+
[#2848]: https://github.com/jsx-eslint/eslint-plugin-react/pull/2848
1533
[#1861]: https://github.com/jsx-eslint/eslint-plugin-react/pull/1861
1634

1735
### Fixed
@@ -4007,6 +4025,7 @@ If you're still not using React 15 you can keep the old behavior by setting the
40074025
[`no-is-mounted`]: docs/rules/no-is-mounted.md
40084026
[`no-multi-comp`]: docs/rules/no-multi-comp.md
40094027
[`no-namespace`]: docs/rules/no-namespace.md
4028+
[`no-object-type-as-default-prop`]: docs/rules/no-object-type-as-default-prop.md
40104029
[`no-redundant-should-component-update`]: docs/rules/no-redundant-should-component-update.md
40114030
[`no-render-return-value`]: docs/rules/no-render-return-value.md
40124031
[`no-set-state`]: docs/rules/no-set-state.md

configs/all.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const allRules = {
8989
'no-unused-class-component-methods': require('../lib/rules/no-unused-class-component-methods'),
9090
'no-unused-prop-types': require('../lib/rules/no-unused-prop-types'),
9191
'no-unused-state': require('../lib/rules/no-unused-state'),
92+
'no-object-type-as-default-prop': require('../lib/rules/no-object-type-as-default-prop'),
9293
'no-will-update-set-state': require('../lib/rules/no-will-update-set-state'),
9394
'prefer-es6-class': require('../lib/rules/prefer-es6-class'),
9495
'prefer-exact-props': require('../lib/rules/prefer-exact-props'),
@@ -123,3 +124,6 @@ module.exports = {
123124
},
124125
rules: allRules,
125126
};
127+
128+
// this is so the `languageOptions` property won't be warned in the new config system
129+
Object.defineProperty(module.exports, 'languageOptions', { enumerable: false });

configs/jsx-runtime.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ module.exports = Object.assign({}, all, {
1313
'react/jsx-uses-react': 0,
1414
},
1515
});
16+
17+
// this is so the `languageOptions` property won't be warned in the new config system
18+
Object.defineProperty(module.exports, 'languageOptions', { enumerable: false });

0 commit comments

Comments
 (0)