[eslint-plugin] Clean up error message

Omits some unncessary details from the error message surfaced in eslint
This commit is contained in:
Lauren Tan
2023-06-28 11:43:56 -04:00
parent f850d3b265
commit 0892e305bc
2 changed files with 3 additions and 3 deletions
@@ -72,7 +72,7 @@ const tests: ForgetTestCases = {
errors: [
{
message:
"[ReactForget] InvalidReact: Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef). Cannot access ref value at freeze $22:TObject<BuiltInRefValue> (6:6)",
"[ReactForget] Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)",
line: 6,
column: 10,
endColumn: 15,
@@ -92,7 +92,7 @@ const tests: ForgetTestCases = {
errors: [
{
message:
"[ReactForget] InvalidReact: React Forget has bailed out of optimizing this component as one or more React eslint rules were disabled. React Forget only works when your components follow all the rules of React, disabling them may result in undefined behavior. eslint-disable-next-line react-hooks/rules-of-hooks (4:4)",
"[ReactForget] React Forget has bailed out of optimizing this component as one or more React eslint rules were disabled. React Forget only works when your components follow all the rules of React, disabling them may result in undefined behavior",
suggestions: [
{
output: normalizeIndent`
@@ -157,7 +157,7 @@ const rule: Rule.RuleModule = {
}
}
context.report({
message: detail.toString(),
message: `[ReactForget] ${detail.reason}`,
loc: detail.loc,
suggest,
});