Skip to content

Commit 3d237f5

Browse files
authored
Merge branch 'jsx-eslint:master' into master
2 parents be72be5 + 865ed16 commit 3d237f5

File tree

7 files changed

+70
-47
lines changed

7 files changed

+70
-47
lines changed

.eslintrc

+11
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,16 @@
6767
"no-console": 0,
6868
},
6969
},
70+
{
71+
"files": ".github/workflows/*.js",
72+
"parserOptions": {
73+
"ecmaVersion": 2019,
74+
},
75+
"rules": {
76+
"camelcase": 0,
77+
"no-console": 0,
78+
"no-restricted-syntax": 0,
79+
},
80+
},
7081
],
7182
}

.github/workflows/npm-publish.yml

+3-34
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,8 @@ jobs:
4848
result-encoding: string
4949
retries: 3
5050
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-
});
51+
const script = require('./.github/workflows/publish');
52+
console.log(await script({ github, context, core }));
8453
8554
publish:
8655
needs: [check-status]
@@ -109,7 +78,7 @@ jobs:
10978
env:
11079
NPM_CONFIG_LEGACY_PEER_DEPS: true
11180

112-
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}" >> .npmrc
81+
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
11382

11483
- run: npm publish --dry-run
11584

.github/workflows/publish.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use strict';
2+
3+
module.exports = async function publish({ github, context, core }) {
4+
const ref = context.payload.inputs.tag;
5+
6+
console.log(`Checking status checks for ${ref}`);
7+
8+
const { owner, repo } = context.repo;
9+
const { default_branch: branch } = context.payload.repository;
10+
11+
const branchData = github.rest.repos.getBranch({ owner, repo, branch });
12+
13+
const { data: { check_suites: checkSuites } } = await github.rest.checks.listSuitesForRef({ owner, repo, ref });
14+
15+
if (checkSuites.some(({ status }) => status === 'completed')) {
16+
core.setFailed(`Some workflows for ${context.payload.inputs.tag} are still in-progress`);
17+
}
18+
19+
const result = await Promise.all(
20+
(await branchData).data.protection.required_status_checks.checks.map(({ context: check_name }) => (
21+
github.rest.checks.listForRef({
22+
owner,
23+
repo,
24+
ref,
25+
check_name,
26+
})
27+
)),
28+
);
29+
30+
console.log(result);
31+
32+
const { data: { check_runs: checkRuns } } = result;
33+
34+
checkRuns.forEach(({ name, status, conclusion }) => {
35+
if (status !== 'completed' || conclusion !== 'success') {
36+
console.log(`${name} check failed`);
37+
core.setFailed(`Required status check ${name} did not succeed`);
38+
}
39+
console.log(`${name} check passed`);
40+
});
41+
};

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1515
* configs: avoid legacy config system error ([#3461][] @ljharb)
1616
* [`jsx-no-target-blank`]: allow ternaries with literals ([#3464][] @akulsr0)
1717
* [`sort-prop-types`]: restore autofixing ([#2574][] @ROSSROSALES)
18+
* [`no-unknown-property`]: add `inert` attribute ([#3484][] @ljharb)
1819

1920
### Changed
2021
* [Perf] component detection: improve performance by avoiding traversing parents unnecessarily ([#3459][] @golopot)
2122
* [Docs] `forbid-component-props`: inclusive language w/ allowlist ([#3473][] @AndersDJohnson)
2223
* [Docs] automate doc generation with `eslint-doc-generator` ([#3469][] @bmish)
2324

25+
[#3484]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3484
2426
[#3473]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3473
2527
[#3469]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3469
2628
[#3464]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3464

lib/rules/no-unknown-property.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const SVGDOM_ATTRIBUTE_NAMES = {
202202
const DOM_PROPERTY_NAMES_ONE_WORD = [
203203
// Global attributes - can be used on any HTML/DOM element
204204
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
205-
'dir', 'draggable', 'hidden', 'id', 'lang', 'nonce', 'part', 'slot', 'style', 'title', 'translate',
205+
'dir', 'draggable', 'hidden', 'id', 'lang', 'nonce', 'part', 'slot', 'style', 'title', 'translate', 'inert',
206206
// Element specific attributes
207207
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
208208
// To be considered if these should be added also to ATTRIBUTE_TAGS_MAP

package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@
2525
"homepage": "https://github.com/jsx-eslint/eslint-plugin-react",
2626
"bugs": "https://github.com/jsx-eslint/eslint-plugin-react/issues",
2727
"dependencies": {
28-
"array-includes": "^3.1.5",
29-
"array.prototype.flatmap": "^1.3.0",
30-
"array.prototype.tosorted": "^1.1.0",
28+
"array-includes": "^3.1.6",
29+
"array.prototype.flatmap": "^1.3.1",
30+
"array.prototype.tosorted": "^1.1.1",
3131
"doctrine": "^2.1.0",
3232
"estraverse": "^5.3.0",
3333
"jsx-ast-utils": "^2.4.1 || ^3.0.0",
3434
"minimatch": "^3.1.2",
35-
"object.entries": "^1.1.5",
36-
"object.fromentries": "^2.0.5",
37-
"object.hasown": "^1.1.1",
38-
"object.values": "^1.1.5",
35+
"object.entries": "^1.1.6",
36+
"object.fromentries": "^2.0.6",
37+
"object.hasown": "^1.1.2",
38+
"object.values": "^1.1.6",
3939
"prop-types": "^15.8.1",
40-
"resolve": "^2.0.0-next.3",
40+
"resolve": "^2.0.0-next.4",
4141
"semver": "^6.3.0",
42-
"string.prototype.matchall": "^4.0.7"
42+
"string.prototype.matchall": "^4.0.8"
4343
},
4444
"devDependencies": {
45-
"@babel/core": "^7.19.3",
45+
"@babel/core": "^7.20.2",
4646
"@babel/eslint-parser": "^7.19.1",
4747
"@babel/plugin-syntax-decorators": "^7.19.0",
4848
"@babel/plugin-syntax-do-expressions": "^7.18.6",

tests/lib/rules/no-unknown-property.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ruleTester.run('no-unknown-property', rule, {
5151
{ code: '<input ref={this.input} type="radio" />' },
5252
{ code: '<input type="file" webkitdirectory="" />' },
5353
{ code: '<input type="file" webkitDirectory="" />' },
54-
{ code: '<div children="anything" />' },
54+
{ code: '<div inert children="anything" />' },
5555
{ code: '<iframe scrolling="?" onLoad={a} onError={b} align="top" />' },
5656
{ code: '<input key="bar" type="radio" />' },
5757
{ code: '<button disabled>You cannot click me</button>;' },
@@ -62,7 +62,7 @@ ruleTester.run('no-unknown-property', rule, {
6262
{ code: '<input type="checkbox" checked={checked} disabled={disabled} id={id} onChange={onChange} />' },
6363
{ code: '<video playsInline />' },
6464
{ code: '<img onError={foo} onLoad={bar} />' },
65-
{ code: '<picture onError={foo} onLoad={bar} />' },
65+
{ code: '<picture inert={false} onError={foo} onLoad={bar} />' },
6666
{ code: '<iframe onError={foo} onLoad={bar} />' },
6767
{ code: '<script onLoad={bar} onError={foo} />' },
6868
{ code: '<source onError={foo} />' },

0 commit comments

Comments
 (0)