Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
### Fixed
* [`jsx-max-depth`]: Prevent getting stuck in circular references ([#2957][] @AriPerkkio)
* [`jsx-no-target-blank`]: fix handling of `warnOnSpreadAttributes` being false ([#2953][] @Nokel81)
* [`forbid-dom-props`]: support `JSXNamespacedName` [#2961][] @mrtnzlml)

### Changed
* Fix CHANGELOG.md ([#2950][] @JounQin)

[#2961]: https://github.com/yannickcr/eslint-plugin-react/pull/2961
[#2953]: https://github.com/yannickcr/eslint-plugin-react/pull/2953
[#2957]: https://github.com/yannickcr/eslint-plugin-react/pull/2957
[#2950]: https://github.com/yannickcr/eslint-plugin-react/pull/2950
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/forbid-dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ module.exports = {
return {
JSXAttribute(node) {
const tag = node.parent.name.name;
if (!(tag && tag[0] !== tag[0].toUpperCase())) {
// This is a Component, not a DOM node, so exit.
if (!(tag && typeof tag === 'string' && tag[0] !== tag[0].toUpperCase())) {
// This is a Component, not a DOM node, so exit.
return;
}

Expand Down
7 changes: 7 additions & 0 deletions tests/lib/rules/forbid-dom-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ ruleTester.run('forbid-element-props', rule, {
');'
].join('\n'),
options: [{forbid: ['id']}]
}, {
code: [
'const First = (props) => (',
' <fbt:param name="name">{props.name}</fbt:param>',
');'
].join('\n'),
options: [{forbid: ['id']}]
}, {
code: [
'const First = (props) => (',
Expand Down