From acbc2ad991c9b341bc1e692f9f169efe8c4902e1 Mon Sep 17 00:00:00 2001 From: Jeremy Hough Date: Sat, 27 Feb 2021 14:33:02 -0500 Subject: [PATCH] Add codelyzer template-accessibility-table-scope converter --- .../lintConfigs/rules/ruleConverters.ts | 2 ++ .../template-accessibility-table-scope.ts | 12 ++++++++++++ .../template-accessibility-table-scope.test.ts | 18 ++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 src/converters/lintConfigs/rules/ruleConverters/codelyzer/template-accessibility-table-scope.ts create mode 100644 src/converters/lintConfigs/rules/ruleConverters/codelyzer/tests/template-accessibility-table-scope.test.ts diff --git a/src/converters/lintConfigs/rules/ruleConverters.ts b/src/converters/lintConfigs/rules/ruleConverters.ts index 748fb774f..dfc803dc8 100644 --- a/src/converters/lintConfigs/rules/ruleConverters.ts +++ b/src/converters/lintConfigs/rules/ruleConverters.ts @@ -162,6 +162,7 @@ import { convertPipePrefix } from "./ruleConverters/codelyzer/pipe-prefix"; import { convertPreferOnPushComponentChangeDetection } from "./ruleConverters/codelyzer/prefer-on-push-component-change-detection"; import { convertPreferOutputReadonly } from "./ruleConverters/codelyzer/prefer-output-readonly"; import { convertRelativeUrlPrefix } from "./ruleConverters/codelyzer/relative-url-prefix"; +import { convertTemplateAccessibilityTableScope } from "./ruleConverters/codelyzer/template-accessibility-table-scope"; import { convertTemplateAccessibilityTabindexNoPositive } from "./ruleConverters/codelyzer/template-accessibility-tabindex-no-positive"; import { convertTemplateBananaInBox } from "./ruleConverters/codelyzer/template-banana-in-box"; import { convertTemplateCyclomaticComplexity } from "./ruleConverters/codelyzer/template-cyclomatic-complexity"; @@ -371,6 +372,7 @@ export const ruleConverters = new Map([ ["space-within-parens", convertSpaceWithinParens], ["strict-boolean-expressions", convertStrictBooleanExpressions], ["switch-default", convertSwitchDefault], + ["template-accessibility-table-scope", convertTemplateAccessibilityTableScope], ["template-accessibility-tabindex-no-positive", convertTemplateAccessibilityTabindexNoPositive], ["template-banana-in-box", convertTemplateBananaInBox], ["template-cyclomatic-complexity", convertTemplateCyclomaticComplexity], diff --git a/src/converters/lintConfigs/rules/ruleConverters/codelyzer/template-accessibility-table-scope.ts b/src/converters/lintConfigs/rules/ruleConverters/codelyzer/template-accessibility-table-scope.ts new file mode 100644 index 000000000..e0380f88d --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/codelyzer/template-accessibility-table-scope.ts @@ -0,0 +1,12 @@ +import { RuleConverter } from "../../ruleConverter"; + +export const convertTemplateAccessibilityTableScope: RuleConverter = () => { + return { + rules: [ + { + ruleName: "@angular-eslint/template/accessibility-table-scope", + }, + ], + plugins: ["@angular-eslint/eslint-plugin-template"], + }; +}; diff --git a/src/converters/lintConfigs/rules/ruleConverters/codelyzer/tests/template-accessibility-table-scope.test.ts b/src/converters/lintConfigs/rules/ruleConverters/codelyzer/tests/template-accessibility-table-scope.test.ts new file mode 100644 index 000000000..cf3fb210d --- /dev/null +++ b/src/converters/lintConfigs/rules/ruleConverters/codelyzer/tests/template-accessibility-table-scope.test.ts @@ -0,0 +1,18 @@ +import { convertTemplateAccessibilityTableScope } from "../template-accessibility-table-scope"; + +describe(convertTemplateAccessibilityTableScope, () => { + test("conversion without arguments", () => { + const result = convertTemplateAccessibilityTableScope({ + ruleArguments: [], + }); + + expect(result).toEqual({ + rules: [ + { + ruleName: "@angular-eslint/template/accessibility-table-scope", + }, + ], + plugins: ["@angular-eslint/eslint-plugin-template"], + }); + }); +});