@@ -7,27 +7,22 @@ import { Options } from "../";
7
7
import { getConfigFileName , parseJSON } from "../utils" ;
8
8
9
9
interface TsfmtSettings {
10
- // from FormatCodeOptions
11
- // コンマ区切り記号の後にスペースを追加する
12
10
insertSpaceAfterCommaDelimiter ?: boolean ;
13
- // 'for' ステートメントでセミコロンの後にスペースを挿入する
14
11
insertSpaceAfterSemicolonInForStatements ?: boolean ;
15
- // 二項演算子の前後にスペースを挿入する
16
12
insertSpaceBeforeAndAfterBinaryOperators ?: boolean ;
17
- // 制御フローステートメント内のキーワードの後にスペースを追加する
13
+ insertSpaceAfterConstructor ?: boolean ;
18
14
insertSpaceAfterKeywordsInControlFlowStatements ?: boolean ;
19
- // 匿名関数に対する関数キーワードの後にスペースを追加する
20
15
insertSpaceAfterFunctionKeywordForAnonymousFunctions ?: boolean ;
21
- // かっこ内が空でない場合に始め括弧の後ろと終わりカッコの前にスペースを挿入する
22
16
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis ?: boolean ;
23
17
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets ?: boolean ;
24
- // template string literalsの括弧内にスペースを挿入する
18
+ insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces ?: boolean ;
25
19
insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces ?: boolean ;
26
- // 新しい行に関数の始め中括弧を配置する
20
+ insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces ?: boolean ;
21
+ insertSpaceAfterTypeAssertion ?: boolean ;
22
+ insertSpaceBeforeFunctionParenthesis ?: boolean ;
27
23
placeOpenBraceOnNewLineForFunctions ?: boolean ;
28
- // 新しい行にコントロールブロックの始め中括弧を配置する
29
24
placeOpenBraceOnNewLineForControlBlocks ?: boolean ;
30
- // from EditorOptions
25
+ baseIndentSize ?: number ;
31
26
indentSize ?: number ;
32
27
// 0, 1, 2 or None, Block, Smart
33
28
indentStyle ?: number | string ;
@@ -62,6 +57,9 @@ export default function makeFormatCodeOptions(fileName: string, opts: Options, f
62
57
if ( typeof config . insertSpaceBeforeAndAfterBinaryOperators === "boolean" ) {
63
58
formatSettings . insertSpaceBeforeAndAfterBinaryOperators = config . insertSpaceBeforeAndAfterBinaryOperators ;
64
59
}
60
+ if ( typeof config . insertSpaceAfterConstructor === "boolean" ) {
61
+ formatSettings . insertSpaceAfterConstructor = config . insertSpaceAfterConstructor ;
62
+ }
65
63
if ( typeof config . insertSpaceAfterKeywordsInControlFlowStatements === "boolean" ) {
66
64
formatSettings . insertSpaceAfterKeywordsInControlFlowStatements = config . insertSpaceAfterKeywordsInControlFlowStatements ;
67
65
}
@@ -71,18 +69,33 @@ export default function makeFormatCodeOptions(fileName: string, opts: Options, f
71
69
if ( typeof config . insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis === "boolean" ) {
72
70
formatSettings . insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis = config . insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis ;
73
71
}
72
+ if ( typeof config . insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces === "boolean" ) {
73
+ formatSettings . insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces = config . insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces ;
74
+ }
74
75
if ( typeof config . insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets === "boolean" ) {
75
76
formatSettings . insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets = config . insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets ;
76
77
}
77
78
if ( typeof config . insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces === "boolean" ) {
78
79
formatSettings . insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces = config . insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces ;
79
80
}
81
+ if ( typeof config . insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces === "boolean" ) {
82
+ formatSettings . insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces = config . insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces ;
83
+ }
84
+ if ( typeof config . insertSpaceAfterTypeAssertion === "boolean" ) {
85
+ formatSettings . insertSpaceAfterTypeAssertion = config . insertSpaceAfterTypeAssertion ;
86
+ }
87
+ if ( typeof config . insertSpaceBeforeFunctionParenthesis === "boolean" ) {
88
+ formatSettings . insertSpaceBeforeFunctionParenthesis = config . insertSpaceBeforeFunctionParenthesis ;
89
+ }
80
90
if ( typeof config . placeOpenBraceOnNewLineForFunctions === "boolean" ) {
81
91
formatSettings . placeOpenBraceOnNewLineForFunctions = config . placeOpenBraceOnNewLineForFunctions ;
82
92
}
83
93
if ( typeof config . placeOpenBraceOnNewLineForControlBlocks === "boolean" ) {
84
94
formatSettings . placeOpenBraceOnNewLineForControlBlocks = config . placeOpenBraceOnNewLineForControlBlocks ;
85
95
}
96
+ if ( typeof config . baseIndentSize === "number" ) {
97
+ formatSettings . baseIndentSize = config . baseIndentSize ;
98
+ }
86
99
if ( typeof config . indentSize === "number" ) {
87
100
formatSettings . indentSize = config . indentSize ;
88
101
}
0 commit comments