[eslint] Turn off validations
We're seeing false positives
Sathya Gunasekaran committed
Nov 14, 2023 at 16:59 UTC
1641f94a8688c45c19261650c4df3fb516f41da4
2 files changed
+5
-16
compiler/packages/eslint-plugin-react-forget/__tests__/ReactForgetDiagnostics-test.ts
+4
-12
@@ -79,9 +79,9 @@ const tests: ForgetTestCases = {
79
}
80
`,
81
},
82
- ],
83
- invalid: [
82
{
83
+ // TODO(gsn): Move this to invalid test suite, when we turn on
84
+ // validateRefAccessDuringRender validation
85
name: "[InvalidInput] Ref access during render",
86
code: normalizeIndent`
87
function Component(props) {
@@ -90,17 +90,9 @@ const tests: ForgetTestCases = {
90
return value;
91
}
92
`,
93
- errors: [
94
- {
95
- message:
96
- "[ReactForget] Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)",
97
- line: 5,
98
- column: 10,
99
- endColumn: 15,
100
- endLine: 5,
101
- },
102
- ],
93
},
94
+ ],
95
+ invalid: [
96
{
97
name: "[InvalidReact] ESlint suppression",
98
// Indentation is intentionally weird so it doesn't add extra whitespace
compiler/packages/eslint-plugin-react-forget/src/rules/ReactForgetDiagnostics.ts
+1
-4
@@ -62,10 +62,7 @@ const COMPILER_OPTIONS: Partial<PluginOptions> = {
62
compilationMode: "infer",
63
panicThreshold: "CRITICAL_ERRORS",
64
environment: {
65
- validateHooksUsage: true,
66
- validateFrozenLambdas: false,
67
- validateRefAccessDuringRender: true,
68
- validateNoSetStateInRender: true,
65
+ validateHooksUsage: false,
66
},
67
};
68