File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed
src/converters/lintConfigs/rules Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 1- import { TSLintRuleOptions } from "./types" ;
1+ import { ESLintRuleSeverity , TSLintRuleOptions } from "./types" ;
22import { ConversionError } from "../../../errors/conversionError" ;
33
44/**
@@ -51,4 +51,9 @@ export type ConvertedRuleChanges = {
5151 * Equivalent ESLint rule name that should be enabled.
5252 */
5353 ruleName : string ;
54+
55+ /**
56+ * Custom severity for the output rule.
57+ */
58+ ruleSeverity ?: ESLintRuleSeverity ;
5459} ;
Original file line number Diff line number Diff line change 11import { RuleConverter } from "../ruleConverter" ;
2+ import { ESLintRuleSeverity } from "../types" ;
23
34export const ConstRequiredForAllCapsMsg =
45 "typescript-eslint does not enforce uppercase for const only." ;
@@ -57,7 +58,7 @@ export const convertVariableName: RuleConverter = (tslintRule) => {
5758 } ;
5859
5960 const getUnderscoreDangleRuleOptions = ( ) => {
60- let underscoreDangleOptionSeverity : string | null = null ;
61+ let underscoreDangleOptionSeverity : ESLintRuleSeverity | undefined ;
6162 const underscoreDangleOptionNotice : string [ ] = [ ] ;
6263
6364 if ( hasCheckFormat && ( allowedLeadingUnderscore || allowedTrailingUnderscore ) ) {
@@ -69,7 +70,7 @@ export const convertVariableName: RuleConverter = (tslintRule) => {
6970
7071 return {
7172 notices : underscoreDangleOptionNotice ,
72- ...( underscoreDangleOptionSeverity !== null && {
73+ ...( underscoreDangleOptionSeverity !== undefined && {
7374 ruleSeverity : underscoreDangleOptionSeverity ,
7475 } ) ,
7576 ruleName : "no-underscore-dangle" ,
@@ -79,16 +80,16 @@ export const convertVariableName: RuleConverter = (tslintRule) => {
7980 const getBlackListRuleOptions = ( ) => {
8081 const blackListOptionArguments = tslintRule . ruleArguments . includes ( "ban-keywords" )
8182 ? [
82- "any" ,
83- "Number" ,
84- "number" ,
85- "String" ,
86- "string" ,
87- "Boolean" ,
88- "boolean" ,
89- "Undefined" ,
90- "undefined" ,
91- ]
83+ "any" ,
84+ "Number" ,
85+ "number" ,
86+ "String" ,
87+ "string" ,
88+ "Boolean" ,
89+ "boolean" ,
90+ "Undefined" ,
91+ "undefined" ,
92+ ]
9293 : [ ] ;
9394
9495 return {
You can’t perform that action at this time.
0 commit comments