Skip to content

Commit 8c2c3af

Browse files
author
Josh Goldberg
authored
Added Codelyzer use-component-selector converter (#542)
* Added codelyzr use-component-selector converter Another non-configurable rule. ⚡ * Added to converters map too...
1 parent 4ecb457 commit 8c2c3af

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertUseComponentSelector } from "../use-component-selector";
2+
3+
describe(convertUseComponentSelector, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertUseComponentSelector({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "@angular-eslint/use-component-selector",
13+
},
14+
],
15+
plugins: ["@angular-eslint/eslint-plugin"],
16+
});
17+
});
18+
});
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 convertUseComponentSelector: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "@angular-eslint/use-component-selector",
8+
},
9+
],
10+
plugins: ["@angular-eslint/eslint-plugin"],
11+
};
12+
};

src/rules/rulesConverters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ import { convertNoPipeImpure } from "./converters/codelyzer/no-pipe-impure";
160160
import { convertNoQueriesMetadataProperty } from "./converters/codelyzer/no-queries-metadata-property";
161161
import { convertPreferOutputReadonly } from "./converters/codelyzer/prefer-output-readonly";
162162
import { convertRelativeUrlPrefix } from "./converters/codelyzer/relative-url-prefix";
163+
import { convertUseComponentSelector } from "./converters/codelyzer/use-component-selector";
163164
import { convertUseInjectableProvidedIn } from "./converters/codelyzer/use-injectable-provided-in";
164165
import { convertUseLifecycleInterface } from "./converters/codelyzer/use-lifecycle-interface";
165166
import { convertUsePipeDecorator } from "./converters/codelyzer/use-pipe-decorator";
@@ -327,6 +328,7 @@ export const rulesConverters = new Map([
327328
["unified-signatures", convertUnifiedSignatures],
328329
["unnecessary-bind", convertUnnecessaryBind],
329330
["unnecessary-constructor", convertUnnecessaryConstructor],
331+
["use-component-selector", convertUseComponentSelector],
330332
["use-default-type-parameter", convertUseDefaultTypeParameter],
331333
["use-injectable-provided-in", convertUseInjectableProvidedIn],
332334
["use-isnan", convertUseIsnan],

0 commit comments

Comments
 (0)