Skip to content

Commit

Permalink
[Fix] no-unknown-property: do not check fbs elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Staman Ogilvie authored and ljharb committed Nov 18, 2022
1 parent c6d082a commit 54c56a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
### Fixed
* configs: avoid legacy config system error ([#3461][] @ljharb)
* [`sort-prop-types`]: restore autofixing ([#3452][] @ROSSROSALES)
* [`no-unknown-property`]: do not check `fbs` elements ([#3494][] @brianogilvie)

[#3494]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3494
[#3461]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3461
[#3452]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3452
[#3449]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3449
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ module.exports = {

const tagName = getTagName(node);

if (tagName === 'fbt') { return; } // fbt nodes are bonkers, let's not go there
if (tagName === 'fbt' || tagName === 'fbs') { return; } // fbt/fbs nodes are bonkers, let's not go there

if (!isValidHTMLTagInJSX(node)) { return; }

Expand Down
2 changes: 2 additions & 0 deletions tests/lib/rules/no-unknown-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ ruleTester.run('no-unknown-property', rule, {

// fbt
{ code: '<fbt desc="foo" doNotExtract />;' },
// fbs
{ code: '<fbs desc="foo" doNotExtract />;' },
]),
invalid: parsers.all([
{
Expand Down

0 comments on commit 54c56a1

Please sign in to comment.