Skip to content

Commit 523dd2c

Browse files
Add notice to arrow-return-shorthand converter (#681)
* Add notice to arrow-return-shorthand converter * Update src/rules/converters/arrow-return-shorthand.ts Co-authored-by: Josh Goldberg <[email protected]>
1 parent 334d46d commit 523dd2c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/rules/converters/arrow-return-shorthand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { RuleConverter } from "../converter";
22

3+
export const ARROW_RETURN_NOTICE =
4+
"ESLint will throw an error if the function body is multiline yet has a one-line return on it.";
5+
36
export const convertArrowReturnShorthand: RuleConverter = (tslintRule) => {
47
return {
58
rules: [
@@ -9,6 +12,7 @@ export const convertArrowReturnShorthand: RuleConverter = (tslintRule) => {
912
ruleArguments: ["always"],
1013
}),
1114
ruleName: "arrow-body-style",
15+
notices: [ARROW_RETURN_NOTICE],
1216
},
1317
],
1418
};

src/rules/converters/tests/arrow-return-shorthand.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { convertArrowReturnShorthand } from "../arrow-return-shorthand";
1+
import { convertArrowReturnShorthand, ARROW_RETURN_NOTICE } from "../arrow-return-shorthand";
22

33
describe(convertArrowReturnShorthand, () => {
44
test("conversion without arguments", () => {
@@ -10,6 +10,7 @@ describe(convertArrowReturnShorthand, () => {
1010
rules: [
1111
{
1212
ruleName: "arrow-body-style",
13+
notices: [ARROW_RETURN_NOTICE],
1314
},
1415
],
1516
});
@@ -25,6 +26,7 @@ describe(convertArrowReturnShorthand, () => {
2526
{
2627
ruleArguments: ["always"],
2728
ruleName: "arrow-body-style",
29+
notices: [ARROW_RETURN_NOTICE],
2830
},
2931
],
3032
});

0 commit comments

Comments
 (0)