Andrew Clark
d256f88ac6
Update local version numbers for 16.10.2 release
2019-10-03 14:14:10 -07:00
Rane Wallin and Sunil Pai
5943b1da6c
Fixing grammatical errors in error message ( #16973 )
...
* Fixing grammatical errors in error message
* Fixing grammar error in test file
2019-10-03 18:14:48 +05:30
Andrew Clark
2a264a9dbe
Update local version numbers for 16.10.1 release
2019-09-28 21:41:42 -07:00
Andrew Clark
93f5f11b79
Update local version numbers for 16.10 release
2019-09-27 13:31:35 -07:00
Dan Abramov
8a01b50fc3
eslint-plugin-react-hooks@2.0.1
2019-08-21 21:40:20 +01:00
Dan Abramov and GitHub
0672829053
Bump ESLint plugin to 2.0 ( #16528 )
2019-08-21 19:14:34 +01:00
Dan Abramov and GitHub
c433fbb593
Revert "Revert "[ESLint] Forbid top-level use*() calls ( #16455 )"" ( #16525 )
...
* Revert "Revert "[ESLint] Forbid top-level use*() calls (#16455 )" (#16522 )"
This reverts commit 507f0fb372 .
* Update RulesOfHooks.js
2019-08-21 15:43:31 +01:00
Sunil Pai and GitHub
507f0fb372
Revert "[ESLint] Forbid top-level use*() calls ( #16455 )" ( #16522 )
...
This reverts commit 96eb703bbf .
2019-08-21 10:20:34 +01:00
Dan Abramov and GitHub
96eb703bbf
[ESLint] Forbid top-level use*() calls ( #16455 )
...
* Add a way to skip/only tests to RulesOfHooks test
* [ESLint] Forbid top-level use*() calls
* Add a regression test for logical expressions
This is not a change. Just adding more coverage.
2019-08-19 19:54:06 +01:00
Hristo Kanchev and Dan Abramov
9e64bf18e1
[eslint-plugin-react-hooks] Fixed crash when referencing arguments in arrow functions. ( #16356 )
...
* Fixed issue with def being undefined while referencing arguments.
* Removed todo comment.
* Skip exhaustive deps check if def is null.
* Fixed code formatting in ExhaustiveDeps.
* Removed unneeded comment in ExhaustiveDeps.
2019-08-14 14:44:06 +01:00
e308a037be
chore: make tests compatible with Jest 24 ( #15779 )
...
* chore: make tests compatible with Jest 24
* remove fake rafs
* rollback jsdom for localstorage compat
* Apply suggestions from code review
Co-Authored-By: Sunil Pai <threepointone@oculus.com >
* chore: cleanup lockfile
2019-08-14 12:32:26 +01:00
Andrew Clark
85d05b3a4d
Bump package.json versions
2019-08-08 14:24:39 -07:00
Min ho Kim and Sunil Pai
2a0f6390ed
Fix typos ( #16076 )
2019-07-08 11:51:29 +01:00
Dan Abramov
d48db594ec
eslint-plugin-react-hooks@1.6.1
2019-06-24 22:31:14 +01:00
Thomas Broyer and Dan Abramov
7439b48cf4
Add explicit support for ESLint 6.0.0 ( #15974 )
...
Preemptively update tests wrt 'parser' requiring an absolute
path rather than a package name, even though the project is
still using ESLint 4.
Fixes #15971
2019-06-24 22:30:12 +01:00
Jordan Rome and Dan Abramov
a383c46788
[ESLint] don't warn for Flow type variables ( #15804 )
...
In Exhaustive Deps check for react-hooks don't warn if the dependency is
a Flow type variable.
2019-06-03 02:20:51 +01:00
Redmond Tran and Christoph Nakazawa
793ef9b855
test(eslint-plugin-react-hooks): add coverage for unused custom hook ( #15130 )
2019-04-25 12:15:29 +01:00
Dan Abramov
f33e5790b8
eslint-plugin-react-hooks@1.6.0
2019-03-22 13:56:07 +00:00
Dan Abramov and GitHub
b1cccd1ed1
Warn about setState directly in dep-less useEffect ( #15184 )
2019-03-22 13:41:10 +00:00
Dan Abramov and GitHub
78968bb3d9
Validate useEffect without deps too ( #15183 )
2019-03-21 20:42:13 +00:00
Dan Abramov and GitHub
f0621fe232
Use same example code for async effect warning ( #15118 )
2019-03-15 19:27:55 +00:00
Dan Abramov and GitHub
f1ff4348c1
Don't suggest a function as its own dep ( #15115 )
2019-03-15 15:14:01 +00:00
Dan Abramov
935f60083f
eslint-plugin-react-hooks@1.5.1
2019-03-14 20:11:22 +00:00
Sophie Alpert and Dan Abramov
1204c78977
[eslint] Wording tweaks ( #15078 )
...
* [eslint] Wording tweaks
I think these are a little clearer.
* fix tests
2019-03-13 18:31:39 +00:00
Dan Abramov
d0289c7e3a
eslint-plugin-react-hooks@1.5.0
2019-03-07 19:43:07 +00:00
Dan Abramov and GitHub
03ad9c73e4
[ESLint] Tweak setState updater message and add useEffect(async) warning ( #15055 )
...
* Use first letter in setCount(c => ...) suggestion
In-person testing showed using original variable name confuses people.
* Warn about async effects
2019-03-07 19:40:23 +00:00
Dan Abramov and GitHub
eb6247a9ab
More concise messages ( #15053 )
2019-03-07 15:21:44 +00:00
Dan Abramov and GitHub
197703ecc7
[ESLint] Add more hints to lint messages ( #15046 )
...
* A clearer message for props destructuring where applicable
* Add line number to the "move function" message
* Add a hint for how to fix callbacks from props
* Simplify code and harden tests
* Collect all dependency references for better warnings
* Suggest updater or reducer where appropriate
2019-03-07 12:39:15 +00:00
Dan Abramov and GitHub
6d2666bab1
Fix ESLint rule crash ( #15044 )
2019-03-07 00:39:39 +00:00
Dan Abramov and GitHub
9b7e1d1389
[ESLint] Suggest moving inside a Hook or useCallback when bare function is a dependency ( #15026 )
...
* Warn about bare function deps and suggest moving or useCallback
* Clearer wording
2019-03-06 23:50:02 +00:00
Dan Abramov and GitHub
5d49dafac8
Enforce deps array in useMemo and useCallback ( #15025 )
2019-03-06 18:17:54 +00:00
Dan Abramov and GitHub
fa5d4ee43b
[ESLint] Treat functions that don't capture anything as static ( #14996 )
...
* Treat functions that don't capture anything as static
* Fix comment
2019-03-05 21:07:37 +00:00
Dan Abramov
f16442a106
eslint-plugin-react-hooks@1.4.0
2019-03-01 20:29:06 +00:00
Dan Abramov and GitHub
e1e45fb367
[ESLint] Suggest to destructure props when they are only used as members ( #14993 )
...
* Suggest to destructure props when they are only used as members
* Add more tests
* Fix a bug
2019-03-01 19:48:48 +00:00
Dan Abramov and GitHub
59ef28437a
Warn about dependencies outside of render scope ( #14990 )
2019-03-01 18:16:17 +00:00
Dan Abramov and GitHub
df7b4768c7
[ESLint] Deduplicate suggested dependencies ( #14982 )
...
* Deduplicate suggested dependencies
* Tweak test cases
2019-03-01 16:10:22 +00:00
Dan Abramov and GitHub
3ada82b741
Allow extraneous effect dependencies ( #14967 )
...
This makes cases like
useEffect(() => {
window.scrollTo(0, 0);
}, [activeTab]);
not warn.
However, it still warns for unused useCallback/useMemo deps.
2019-02-27 16:59:11 +00:00
Dan Abramov and GitHub
0b8efb229c
Allow omitting constant primitive deps ( #14959 )
2019-02-26 16:12:15 +00:00
Dan Abramov
3989c09500
eslint-plugin-react-hooks@1.3.0
2019-02-25 17:27:37 +00:00
Dan Abramov and GitHub
1bbfbc98d2
[ESLint] Add more cases to exhaustive-deps rule ( #14930 )
...
* Add better message for literal dependencies
* Warn about ref.current in cleanup phase
* Fix wrong comment
* Tweak wording
2019-02-25 16:00:29 +00:00
Farhad Yasir and Dan Abramov
412f882968
fix(eslint-plugin-react-hooks): node engine updated to version 7 because of object.entries ( #14951 )
2019-02-25 15:37:06 +00:00
Matt Thomson and Dan Abramov
f99fca3cb2
Fix sample ESLint configuration ( #14926 )
...
See [ESLint docs](https://eslint.org/docs/user-guide/configuring#configuring-rules )
2019-02-22 12:22:07 +00:00
Dan Abramov
22bb947642
Release eslint-plugin-react-hooks@1.2.0
2019-02-21 19:41:35 +00:00
Dan Abramov and GitHub
a77bbf1a1c
[ESLint] Warn against assignments from inside Hooks ( #14916 )
...
* [ESLint] Warn against assignments from inside Hooks
* Include variable name
* Add a test for the legit case
2019-02-21 19:23:00 +00:00
Dan Abramov
8c1966590a
Release 16.8.3
2019-02-21 18:09:18 +00:00
Dan Abramov and GitHub
dab2fdbbbd
Add eslint-plugin-react-hooks/exhaustive-deps rule to check stale closure dependencies ( #14636 )
...
* Add ESLint rule for useEffect/useCallback/useMemo Hook dependencies
* Fix ReactiveDependencies rule
* fix lint errors
* Support useLayoutEffect
* Add some failing tests and comments
* Gather dependencies in child scopes too
* If we don't find foo.bar.baz in deps, try foo.bar, then foo
* foo is enough for both foo.bar and foo.baz
* Shorter rule name
* Add fixable meta
* Remove a bunch of code and start from scratch
* [WIP] Only report errors from dependency array
This results in nicer editing experience. Also has autofix.
* Fix typo
* [Temp] Skip all tests
* Fix the first test
* Revamp the test suite
* Fix [foo] to include foo.bar
* Don't suggest call expressions
* Special case 'current' for refs
* Don't complain about known static deps
* Support useImperativeHandle
* Better punctuation and formatting
* More uniform message format
* Treat React.useRef/useState/useReducer as static too
* Add special message for ref.current
* Add a TODO case
* Alphabetize the autofix
* Only alphabetize if it already was
* Don't add static deps by default
* Add an undefined variable case
* Tweak wording
* Rename to exhaustive-deps
* Clean up / refactor a little bit
2019-02-20 18:18:58 +00:00
Dan Abramov
3e55560438
Release 16.8.2
2019-02-14 19:13:15 +00:00
zhuoli99 and Sophie Alpert
c11015ff4f
fix spelling mistakes ( #14805 )
2019-02-09 16:43:49 -08:00
Brian Vaughn
45fc46bfa0
16.8.1 packages
2019-02-06 18:21:33 +00:00
Brian Vaughn
0975ea3278
eslint-plugin-react-hooks v1.0.0
2019-02-06 10:14:57 +00:00