Skip to content

feat(linter): change react/rules-of-hooks category to pedantic#7691

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-06-feat_linter_change_react_rules-of-hooks_category_to_pedantic_
Dec 6, 2024
Merged

feat(linter): change react/rules-of-hooks category to pedantic#7691
graphite-app[bot] merged 1 commit intomainfrom
12-06-feat_linter_change_react_rules-of-hooks_category_to_pedantic_

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Dec 6, 2024

Although this rule is recommended by the React team,
it does not report incorrect or wrong code for the correctness category.

When turned on by default, I find false positive warnings confusing,
I cannot tell whether my code is wrong or the rule implementation is
wrong - see examples in the affine repo.

  x eslint-plugin-react-hooks(rules-of-hooks): React Hook "use" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.
    ,-[packages/backend/server/src/config/affine.self.ts:80:1]
 79 |     /* Captcha Plugin Default Config */
 80 | ,-> AFFiNE.use('captcha', {
 81 | |     turnstile: {},
 82 | |     challenge: {
 83 | |       bits: 20,
 84 | |     },
 85 | `-> });
 86 |
    `----

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 6, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@Boshen Boshen requested a review from camc314 December 6, 2024 03:45
@github-actions github-actions bot added the A-linter Area - Linter label Dec 6, 2024
Copy link
Member Author

Boshen commented Dec 6, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Dec 6, 2024
@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 6, 2024

Merge activity

…7691)

Although this rule is recommended by the React team,
it does not report incorrect or wrong code for the `correctness` category.

When turned on by default, I find false positive warnings confusing,
I cannot tell whether my code is wrong or the rule implementation is
wrong - see examples in the affine repo.

```
  x eslint-plugin-react-hooks(rules-of-hooks): React Hook "use" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.
    ,-[packages/backend/server/src/config/affine.self.ts:80:1]
 79 |     /* Captcha Plugin Default Config */
 80 | ,-> AFFiNE.use('captcha', {
 81 | |     turnstile: {},
 82 | |     challenge: {
 83 | |       bits: 20,
 84 | |     },
 85 | `-> });
 86 |
    `----
```
@Boshen Boshen force-pushed the 12-06-feat_linter_change_react_rules-of-hooks_category_to_pedantic_ branch from 106bd4f to fd0935c Compare December 6, 2024 03:49
@graphite-app graphite-app bot merged commit fd0935c into main Dec 6, 2024
@graphite-app graphite-app bot deleted the 12-06-feat_linter_change_react_rules-of-hooks_category_to_pedantic_ branch December 6, 2024 03:54
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 6, 2024

CodSpeed Performance Report

Merging #7691 will not alter performance

Comparing 12-06-feat_linter_change_react_rules-of-hooks_category_to_pedantic_ (fd0935c) with main (7cee065)

Summary

✅ 29 untouched benchmarks

@oxc-bot oxc-bot mentioned this pull request Dec 6, 2024
@camc314
Copy link
Contributor

camc314 commented Dec 6, 2024

we are roporting correctly in Affine repo.
if i run reacts lint rule with eslint, i get the same errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants