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" ;
2
2
import { ConversionError } from "../../../errors/conversionError" ;
3
3
4
4
/**
@@ -51,4 +51,9 @@ export type ConvertedRuleChanges = {
51
51
* Equivalent ESLint rule name that should be enabled.
52
52
*/
53
53
ruleName : string ;
54
+
55
+ /**
56
+ * Custom severity for the output rule.
57
+ */
58
+ ruleSeverity ?: ESLintRuleSeverity ;
54
59
} ;
Original file line number Diff line number Diff line change 1
1
import { RuleConverter } from "../ruleConverter" ;
2
+ import { ESLintRuleSeverity } from "../types" ;
2
3
3
4
export const ConstRequiredForAllCapsMsg =
4
5
"typescript-eslint does not enforce uppercase for const only." ;
@@ -57,7 +58,7 @@ export const convertVariableName: RuleConverter = (tslintRule) => {
57
58
} ;
58
59
59
60
const getUnderscoreDangleRuleOptions = ( ) => {
60
- let underscoreDangleOptionSeverity : string | null = null ;
61
+ let underscoreDangleOptionSeverity : ESLintRuleSeverity | undefined ;
61
62
const underscoreDangleOptionNotice : string [ ] = [ ] ;
62
63
63
64
if ( hasCheckFormat && ( allowedLeadingUnderscore || allowedTrailingUnderscore ) ) {
@@ -69,7 +70,7 @@ export const convertVariableName: RuleConverter = (tslintRule) => {
69
70
70
71
return {
71
72
notices : underscoreDangleOptionNotice ,
72
- ...( underscoreDangleOptionSeverity !== null && {
73
+ ...( underscoreDangleOptionSeverity !== undefined && {
73
74
ruleSeverity : underscoreDangleOptionSeverity ,
74
75
} ) ,
75
76
ruleName : "no-underscore-dangle" ,
@@ -79,16 +80,16 @@ export const convertVariableName: RuleConverter = (tslintRule) => {
79
80
const getBlackListRuleOptions = ( ) => {
80
81
const blackListOptionArguments = tslintRule . ruleArguments . includes ( "ban-keywords" )
81
82
? [
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
+ ]
92
93
: [ ] ;
93
94
94
95
return {
You can’t perform that action at this time.
0 commit comments