@@ -28,31 +28,19 @@ const RULE_OPTION_NAMES = (
2828const toKebabCase = ( value : string ) =>
2929 value . replaceAll ( / [ A - Z ] / g, char => `-${ char . toLowerCase ( ) } ` )
3030
31- /** Resolve the line width, inheriting Prettier's `printWidth`. */
32- const resolveLineWidth = ( options : PrettierOptions ) =>
33- Number . isFinite ( options . printWidth ) ? options . printWidth : undefined
34-
35- /** Resolve the indentation style, inheriting Prettier's `useTabs`. */
36- const resolveIndentStyle = ( options : PrettierOptions ) =>
37- options . useTabs ? 'tab' : 'space'
38-
39- /** Resolve the string quote style, inheriting Prettier's `singleQuote`. */
40- const resolveStringQuoteStyle = ( options : PrettierOptions ) =>
41- options . stringQuoteStyle ?? ( options . singleQuote ? 'single' : 'double' )
42-
43- /** Resolve inline table spacing, inheriting Prettier's `bracketSpacing`. */
44- const resolveInlineTableBraceSpaceWidth = ( options : PrettierOptions ) =>
45- options . inlineTableBraceSpaceWidth ?? ( options . bracketSpacing ? 1 : 0 )
46-
4731/** The rules derived from Prettier's own core options. */
4832const getCoreRules = (
4933 options : PrettierOptions ,
5034) : Record < string , TombiRuleValue > => ( {
51- lineWidth : resolveLineWidth ( options ) ,
35+ lineWidth : Number . isFinite ( options . printWidth )
36+ ? options . printWidth
37+ : undefined ,
5238 indentWidth : options . tabWidth ,
53- indentStyle : resolveIndentStyle ( options ) ,
54- stringQuoteStyle : resolveStringQuoteStyle ( options ) ,
55- inlineTableBraceSpaceWidth : resolveInlineTableBraceSpaceWidth ( options ) ,
39+ indentStyle : options . useTabs ? 'tab' : 'space' ,
40+ stringQuoteStyle :
41+ options . stringQuoteStyle ?? ( options . singleQuote ? 'single' : 'double' ) ,
42+ inlineTableBraceSpaceWidth :
43+ options . inlineTableBraceSpaceWidth ?? ( options . bracketSpacing ? 1 : 0 ) ,
5644} )
5745
5846/** All rules derived from the resolved Prettier options. */
0 commit comments