Commit 88416b2
authored
feat: new
* refactor: rename function to detect potential Testing Library func
* feat(no-unnecessary-act): first approach for the rule
* feat(no-unnecessary-act): first bunch of tests
* test: update number of expected rules
* feat(no-unnecessary-act): detect error from returns
* refactor: extract util to determine if a function is empty
* feat(no-unnecessary-act): detect error for empty callbacks
* refactor(no-unnecessary-act): function to find non-testing-library calls
* refactor(no-unnecessary-act): update docs recommended config
* fix: check if node is coming from Testing Library correctly
isNodeComingFromTestingLibrary wasn't checking if the imported
declaration name matches some Testing Library valid module
* feat: save react-dom/test-utils import in detection mechanism
* refactor: extract function for finding import specifier
* refactor(no-unnecessary-act): detect act from React DOM test utils
* fix: remove duplicated isVariableDeclaration declaration
* feat(no-unnecessary-act): detect edge and mixed cases
* docs(no-unnecessary-act): add rule details
* docs(no-unnecessary-act): include rule in README
* refactor: rename findImportedTestingLibraryUtilSpecifier in helpers
* docs(no-unnecessary-act): simplify examples
* refactor: remove unnecessary comment
* fix(no-unnecessary-act): cover more trees searching for statements
* test(no-unnecessary-act): extra cases for thenable promises
Closes #259
Co-authored-by: @alessbellno-unnecessary-act rule (#365)1 parent 816df6e commit 88416b2
File tree
8 files changed
+1371
-82
lines changed- docs/rules
- lib
- create-testing-library-rule
- node-utils
- rules
- tests
- lib/rules
8 files changed
+1371
-82
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
0 commit comments