File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,7 +157,10 @@ export function fromEditorConfig(
157157
158158 if ( Number . isInteger ( config . tab_width ) ) {
159159 resolved . tabSize = config . tab_width
160- } else if ( Number . isInteger ( config . indent_size ) ) {
160+ } else if (
161+ Number . isInteger ( config . indent_size ) &&
162+ config . tab_width !== 'unset'
163+ ) {
161164 resolved . tabSize = config . indent_size
162165 }
163166
Original file line number Diff line number Diff line change @@ -181,6 +181,21 @@ suite('EditorConfig extension', () => {
181181 indentSize : 2 ,
182182 } ,
183183 } ,
184+ {
185+ config : {
186+ indent_style : 'tab' ,
187+ indent_size : 8 ,
188+ tab_width : 'unset' ,
189+ } ,
190+ defaults : {
191+ tabSize : 2 ,
192+ } ,
193+ expected : {
194+ insertSpaces : false ,
195+ indentSize : 8 ,
196+ tabSize : 2 ,
197+ } ,
198+ } ,
184199 ] . forEach ( scenario => {
185200 assert . deepStrictEqual (
186201 api . fromEditorConfig ( scenario . config as KnownProps , scenario . defaults ) ,
You can’t perform that action at this time.
0 commit comments