diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce8d6aa..db8066f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,11 @@
# Unreleased
+- Rule `no-unused-vars` has been adjusted to take [`fbt`](https://facebook.github.io/fbt/) oddities into account. This reverts the version pin of `eslint-plugin-react` introduced in 6.5.1. For more details please visit: https://github.com/yannickcr/eslint-plugin-react/issues/3080
- New rule [`flowtype/no-duplicate-type-union-intersection-members`](https://github.com/gajus/eslint-plugin-flowtype/blob/1c1c009ba2a58b9660d43c43750396bef8d73904/.README/rules/no-duplicate-type-union-intersection-members.md) has been enabled (as warnings or errors in strict mode).
# 6.5.1
-- Dependency `eslint-plugin-react` was temporarily pined to version 7.25.1 because of a new issue with FBT tags: https://github.com/yannickcr/eslint-plugin-react/issues/3080
+- Dependency `eslint-plugin-react` has been temporarily pined to version 7.25.1 because of a new issue with FBT tags: https://github.com/yannickcr/eslint-plugin-react/issues/3080
# 6.5.0
diff --git a/__tests__/__fixtures__/invalid-eslint-examples/react/no-unused-vars.js b/__tests__/__fixtures__/invalid-eslint-examples/react/no-unused-vars.js
new file mode 100644
index 0000000..a72d6af
--- /dev/null
+++ b/__tests__/__fixtures__/invalid-eslint-examples/react/no-unused-vars.js
@@ -0,0 +1,12 @@
+// @flow strict
+
+// eslint-disable-next-line no-unused-vars
+const someUnusedVar = 42;
+
+// eslint-disable-next-line no-unused-vars
+function fact(n) {
+ if (n < 2) {
+ return 1;
+ }
+ return n * fact(n - 1);
+}
diff --git a/__tests__/__fixtures__/valid-eslint-examples/react/no-unused-vars.js b/__tests__/__fixtures__/valid-eslint-examples/react/no-unused-vars.js
new file mode 100644
index 0000000..09ee5c0
--- /dev/null
+++ b/__tests__/__fixtures__/valid-eslint-examples/react/no-unused-vars.js
@@ -0,0 +1,13 @@
+/**
+ * This code should NOT report `no-unused-vars` error on FBT import, see:
+ * https://github.com/yannickcr/eslint-plugin-react/issues/3080
+ *
+ * @flow
+ */
+
+import fbt from 'fbt'; // eslint-disable-line import/no-extraneous-dependencies
+import type { Node } from 'react';
+
+export default function MyComponent(): Node {
+ return test;
+}
diff --git a/__tests__/__snapshots__/index.test.js.snap b/__tests__/__snapshots__/index.test.js.snap
index ce4cd8d..adbdcce 100644
--- a/__tests__/__snapshots__/index.test.js.snap
+++ b/__tests__/__snapshots__/index.test.js.snap
@@ -625,6 +625,7 @@ Object {
"args": "after-used",
"argsIgnorePattern": "^_$",
"ignoreRestSiblings": true,
+ "varsIgnorePattern": "^fbt$",
},
],
"no-use-before-define": 0,
@@ -852,6 +853,7 @@ Object {
"ignoreStateless": true,
},
],
+ "react/no-namespace": 0,
"react/no-redundant-should-component-update": 2,
"react/no-render-return-value": 2,
"react/no-set-state": 0,
diff --git a/__tests__/__snapshots__/presets.test.js.snap b/__tests__/__snapshots__/presets.test.js.snap
index df17082..a022e56 100644
--- a/__tests__/__snapshots__/presets.test.js.snap
+++ b/__tests__/__snapshots__/presets.test.js.snap
@@ -379,6 +379,7 @@ Object {
"args": "after-used",
"argsIgnorePattern": "^_$",
"ignoreRestSiblings": true,
+ "varsIgnorePattern": "^fbt$",
},
],
"no-use-before-define": 0,
@@ -948,6 +949,7 @@ Object {
"ignoreStateless": true,
},
],
+ "react/no-namespace": 0,
"react/no-redundant-should-component-update": 2,
"react/no-render-return-value": 2,
"react/no-set-state": 0,
diff --git a/package.json b/package.json
index 29996a6..762b570 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,7 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^5.1.0",
- "eslint-plugin-react": "7.25.1",
+ "eslint-plugin-react": "^7.26.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.11.0",
"eslint-plugin-relay": "^1.8.2",
diff --git a/src/presets/base.js b/src/presets/base.js
index 2b5de75..d6cb4c3 100644
--- a/src/presets/base.js
+++ b/src/presets/base.js
@@ -165,6 +165,7 @@ module.exports = ({
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_$', // (_) => { … }
+ varsIgnorePattern: '^fbt$', // https://github.com/yannickcr/eslint-plugin-react/issues/3080
},
],
'no-use-before-define': OFF, // https://github.com/babel/babel-eslint/issues/485
diff --git a/src/presets/react.js b/src/presets/react.js
index f220536..4424385 100644
--- a/src/presets/react.js
+++ b/src/presets/react.js
@@ -78,6 +78,7 @@ module.exports = ({
'react/no-find-dom-node': ERROR,
'react/no-is-mounted': ERROR,
'react/no-multi-comp': [ERROR, { ignoreStateless: true }],
+ 'react/no-namespace': OFF, // complains about `` and similar
'react/no-redundant-should-component-update': ERROR,
'react/no-render-return-value': ERROR,
'react/no-set-state': OFF,