Skip to content

Commit 2f64dea

Browse files
committed
[Fix] no-unknown-property: allow transform-origin on rect
Fixes #3914
1 parent 2428618 commit 2f64dea

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1010
* [`no-unknown-property`]: allow shadow root attrs on `<template>` ([#3912][] @ljharb)
1111
* [`prop-types`]: support `ComponentPropsWithRef` from a namespace import ([#3651][] @corydeppen)
1212
* [`jsx-no-constructed-context-values`]: detect constructed context values in React 19 `<Context>` usage ([#3910][] @TildaDares)
13+
* [`no-unknown-property`]: allow `transform-origin` on `rect` ([#3914][] @ljharb)
1314

1415
### Changed
1516
* [Docs] [`button-has-type`]: clean up phrasing ([#3909][] @hamirmahal)
1617

18+
[#3914]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3914
1719
[#3912]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3912
1820
[#3910]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3910
1921
[#3909]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3909

Diff for: lib/rules/no-unknown-property.js

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ const ATTRIBUTE_TAGS_MAP = {
122122
shadowrootclonable: ['template'],
123123
shadowrootdelegatesfocus: ['template'],
124124
shadowrootserializable: ['template'],
125+
'transform-origin': ['rect'],
125126
};
126127

127128
const SVGDOM_ATTRIBUTE_NAMES = {

Diff for: tests/lib/rules/no-unknown-property.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ ruleTester.run('no-unknown-property', rule, {
377377
],
378378
},
379379
{
380-
code: '<rect clip-path="bar" />;',
381-
output: '<rect clipPath="bar" />;',
380+
code: '<rect clip-path="bar" transform-origin="center" />;',
381+
output: '<rect clipPath="bar" transform-origin="center" />;',
382382
errors: [
383383
{
384384
messageId: 'unknownPropWithStandardName',

0 commit comments

Comments
 (0)