Skip to content

Commit 1c05e47

Browse files
author
Josh Goldberg
authored
1 parent cae640d commit 1c05e47

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { RuleConverter } from "../../converter";
2+
3+
export const convertPreferOnPushComponentChangeDetection: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "@angular-eslint/prefer-on-push-component-change-detection",
8+
},
9+
],
10+
plugins: ["@angular-eslint/eslint-plugin"],
11+
};
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertPreferOnPushComponentChangeDetection } from "../prefer-on-push-component-change-detection";
2+
3+
describe(convertPreferOnPushComponentChangeDetection, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertPreferOnPushComponentChangeDetection({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "@angular-eslint/prefer-on-push-component-change-detection",
13+
},
14+
],
15+
plugins: ["@angular-eslint/eslint-plugin"],
16+
});
17+
});
18+
});

src/rules/rulesConverters.ts

+2
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ import { convertNoOutputRename } from "./converters/codelyzer/no-output-rename";
158158
import { convertNoOutputsMetadataProperty } from "./converters/codelyzer/no-outputs-metadata-property";
159159
import { convertNoPipeImpure } from "./converters/codelyzer/no-pipe-impure";
160160
import { convertNoQueriesMetadataProperty } from "./converters/codelyzer/no-queries-metadata-property";
161+
import { convertPreferOnPushComponentChangeDetection } from "./converters/codelyzer/prefer-on-push-component-change-detection";
161162
import { convertPreferOutputReadonly } from "./converters/codelyzer/prefer-output-readonly";
162163
import { convertRelativeUrlPrefix } from "./converters/codelyzer/relative-url-prefix";
163164
import { convertUseComponentSelector } from "./converters/codelyzer/use-component-selector";
@@ -308,6 +309,7 @@ export const rulesConverters = new Map([
308309
["prefer-for-of", convertPreferForOf],
309310
["prefer-function-over-method", convertPreferFunctionOverMethod],
310311
["prefer-object-spread", convertPreferObjectSpread],
312+
["prefer-on-push-component-change-detection", convertPreferOnPushComponentChangeDetection],
311313
["prefer-output-readonly", convertPreferOutputReadonly],
312314
["prefer-readonly", convertPreferReadonly],
313315
["prefer-template", convertPreferTemplate],

0 commit comments

Comments
 (0)