Commit Graph

12 Commits

Author SHA1 Message Date
lauren
ff697fc58b
[eprh] Temporarily disable ref access in render validation (#32839)
This rule currently has a few false positives, so let's disable it for
now (just in the eslint rule, it's still enabled in the compiler) while
we iterate on it.
2025-04-09 14:49:31 -04:00
mofeiZ
5398b71158
[compiler] detect and throw on untransformed required features (#32512)
Traverse program after running compiler transform to find untransformed
references to compiler features (e.g. `inferEffectDeps`, `fire`).

Hard error to fail the babel pipeline when the compiler fails to
transform these features to give predictable runtime semantics.
Untransformed calls to functions like `fire` will throw at runtime
anyways, so let's fail the build to catch these earlier.

Note that with this fails the build *regardless of panicThreshold*
2025-03-14 11:44:49 -04:00
Lauren Tan
34edf3b684
[compiler] Surface unused opt out directives in eslint
This PR updates the eslint plugin to report unused opt out directives.
One of the downsides of the opt out directive is that it opts the
component/hook out of compilation forever, even if the underlying issue
was fixed in product code or fixed in the compiler.

ghstack-source-id: 81deb5c11b
Pull Request resolved: https://github.com/facebook/react/pull/30721
2024-08-16 18:12:05 -04:00
Mike Vitousek
5edbe29dbe [compiler] Make ref enforcement on by default
Summary:
The change earlier in this stack makes it less safe to have ref enforcement disabled. This diff enables it by default.

ghstack-source-id: d3ab5f1b28b7aed0f0d6d69547bb638a1e326b66
Pull Request resolved: https://github.com/facebook/react/pull/30716
2024-08-16 13:27:14 -04:00
Jan Kassens
fd2b3e13d3
Compiler: unfork prettier config (#30205)
Updates the prettier config to format all `.ts` and `.tsx` files in the
repo using the existing defaults and removing overrides.

The first commit in this PR contains the config changes, the second is
just the result of running `yarn prettier-all`.
2024-07-18 17:00:24 -04:00
Mofei Zhang
1f60a41801 [compiler][eslint] Add donotuse flag for bailouts
---
Adding an experimental / donotuse flag for small Meta internal usecase

ghstack-source-id: 908ef1e150c9fef1347616c9c4dc6bf3316900b0
Pull Request resolved: https://github.com/facebook/react/pull/30342
2024-07-15 17:56:04 -04:00
Mofei Zhang
e307a49544 [compiler][eslint] Use logger callback instead of exceptions to report eslint diagnostics
---
* panicThreshold: `all_errors` -> `none`
* inject an error logger through compiler config (instead of using exceptions)

We currently report at most one lint warning per file, this lets us exhaustively report all available ones (see new
test fixture for example)

ghstack-source-id: 5299315574d11929efc39ee8f6033e3035d1e378
Pull Request resolved: https://github.com/facebook/react/pull/30336
2024-07-15 17:56:04 -04:00
Mofei Zhang
6cca9c3184 [compiler][be] Fix lint violations in eslint-plugin
ghstack-source-id: 7c11dce833fcf8f46aaa23858ac94a05e870fae8
Pull Request resolved: https://github.com/facebook/react/pull/30335
2024-07-15 17:56:04 -04:00
Lauren Tan
d0a51e7dfc Allow eslint rule reportable severity to be set
During the demo I might show an example of fixing a
CannotPreserveMemoization error. But I don't want to make that
reportable by default, so this PR allows configuration like so

```js
module.exports = {
  root: true,
  plugins: [
    'eslint-plugin-react-compiler',
  ],
  rules: {
    'react-compiler/react-compiler': [
      'error', {
        reportableLevels: new Set([
          'InvalidJs',
          'InvalidReact',
          'CannotPreserveMemoization'
        ])
      }
     ]
  }
}
```

ghstack-source-id: 984c6d3cb7e19c8fea2bb88108dd26335c031573
Pull Request resolved: https://github.com/facebook/react-forget/pull/2936
2024-05-06 20:07:36 -04:00
Joe Savona
87993f333a [dx] Update suppression error messages
ghstack-source-id: 0c362a349de86a07b4e9e381b942939ce4a24e69
Pull Request resolved: https://github.com/facebook/react-forget/pull/2859
2024-04-17 18:25:40 -07:00
Lauren Tan
7748ce8f3f Update compiler naming in remaining error text 2024-03-28 10:40:05 -04:00
Jan Kassens
72d374e978 [linter] rename ReactForgetDiagnostics to ReactCompilerRule
[linter] rename ReactForgetDiagnostics to ReactCompilerRule
2024-03-14 11:53:32 -04:00