@samitouri / QOS-React-2 / commits / 0892e305bc

[eslint-plugin] Clean up error message

Omits some unncessary details from the error message surfaced in eslint

Lauren Tan committed Jun 28, 2023 at 11:43 UTC 0892e305bc8397fee6db6e8e14d36fcb99b49de9
2 files changed +3 -3
compiler/forget/packages/eslint-plugin-react-forget/__tests__/ReactForgetDiagnostics-test.ts
+2 -2
@@ -72,7 +72,7 @@ const tests: ForgetTestCases = {
72 errors: [
73 {
74 message:
75 - "[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)",
75 + "[ReactForget] Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)",
76 line: 6,
77 column: 10,
78 endColumn: 15,
@@ -92,7 +92,7 @@ const tests: ForgetTestCases = {
92 errors: [
93 {
94 message:
95 - "[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)",
95 + "[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",
96 suggestions: [
97 {
98 output: normalizeIndent`
compiler/forget/packages/eslint-plugin-react-forget/src/rules/ReactForgetDiagnostics.ts
+1 -1
@@ -157,7 +157,7 @@ const rule: Rule.RuleModule = {
157 }
158 }
159 context.report({
160 - message: detail.toString(),
160 + message: `[ReactForget] ${detail.reason}`,
161 loc: detail.loc,
162 suggest,
163 });