Skip to content

Commit 39c2617

Browse files
author
Josh Goldberg
authored
1 parent 7a056c2 commit 39c2617

File tree

3 files changed

+34
-2
lines changed

3 files changed

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

src/rules/rulesConverters.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,11 @@ import { convertNoHostMetadataProperty } from "./converters/codelyzer/no-host-me
151151
import { convertNoInputPrefix } from "./converters/codelyzer/no-input-prefix";
152152
import { convertNoInputRename } from "./converters/codelyzer/no-input-rename";
153153
import { convertNoInputsMetadataProperty } from "./converters/codelyzer/no-inputs-metadata-property";
154-
import { convertNoOutputNative } from "./converters/codelyzer/no-output-native";
155-
import { convertNoOutputsMetadataProperty } from "./converters/codelyzer/no-outputs-metadata-property";
156154
import { convertNoLifecycleCall } from "./converters/codelyzer/no-lifecycle-call";
155+
import { convertNoOutputNative } from "./converters/codelyzer/no-output-native";
157156
import { convertNoOutputOnPrefix } from "./converters/codelyzer/no-output-on-prefix";
157+
import { convertNoOutputsMetadataProperty } from "./converters/codelyzer/no-outputs-metadata-property";
158+
import { convertPreferOutputReadonly } from "./converters/codelyzer/prefer-output-readonly";
158159
import { convertUseInjectableProvidedIn } from "./converters/codelyzer/use-injectable-provided-in";
159160
import { convertUseLifecycleInterface } from "./converters/codelyzer/use-lifecycle-interface";
160161
import { convertUsePipeDecorator } from "./converters/codelyzer/use-pipe-decorator";
@@ -297,6 +298,7 @@ export const rulesConverters = new Map([
297298
["prefer-for-of", convertPreferForOf],
298299
["prefer-function-over-method", convertPreferFunctionOverMethod],
299300
["prefer-object-spread", convertPreferObjectSpread],
301+
["prefer-output-readonly", convertPreferOutputReadonly],
300302
["prefer-readonly", convertPreferReadonly],
301303
["prefer-template", convertPreferTemplate],
302304
["promise-function-async", convertPromiseFunctionAsync],

0 commit comments

Comments
 (0)