@@ -19,11 +19,7 @@ import {
19
19
GLOB_TSX ,
20
20
GLOB_YAML ,
21
21
} from "../globs" ;
22
- import type {
23
- FlatConfigItem ,
24
- OptionsFormatters ,
25
- StylisticConfig ,
26
- } from "../types" ;
22
+ import type { FlatConfigItem , OptionsFormatters , StylisticConfig } from "../types" ;
27
23
import { loadPackages , parserPlain } from "../utils" ;
28
24
29
25
export async function formatters (
@@ -46,21 +42,16 @@ export async function formatters(
46
42
}
47
43
: opts ;
48
44
49
- if (
50
- options . slidev !== false &&
51
- options . slidev !== undefined &&
52
- options . markdown !== true
53
- ) {
54
- throw new Error (
55
- "`slidev` option only works when `markdown` is enabled with `prettier`" ,
56
- ) ;
45
+ if ( options . slidev !== false && options . slidev !== undefined && options . markdown !== true ) {
46
+ throw new Error ( "`slidev` option only works when `markdown` is enabled with `prettier`" ) ;
57
47
}
58
48
59
49
const { indent, quotes, semi } = stylistic ;
60
50
61
51
const prettierOptions : PrettierOptions = Object . assign (
62
52
{
63
53
endOfLine : "lf" ,
54
+ printWidth : 120 ,
64
55
semi : semi ?? true ,
65
56
singleQuote : quotes === "single" ,
66
57
tabWidth : typeof indent === "number" ? indent : 2 ,
@@ -79,11 +70,7 @@ export async function formatters(
79
70
] ) ) as [ ESLint . Plugin , ESLint . ConfigData , unknown , unknown ] ;
80
71
81
72
const turnOffRulesForPrettier = {
82
- ...Object . fromEntries (
83
- Object . entries ( configPrettier . rules ?? { } ) . filter (
84
- ( [ , value ] ) => value === "off" ,
85
- ) ,
86
- ) ,
73
+ ...Object . fromEntries ( Object . entries ( configPrettier . rules ?? { } ) . filter ( ( [ , value ] ) => value === "off" ) ) ,
87
74
88
75
"no-irregular-whitespace" : "off" ,
89
76
// "style/lines-around-comment": "off",
@@ -569,7 +556,6 @@ export async function formatters(
569
556
"format/prettier" : [
570
557
"error" ,
571
558
{
572
- printWidth : 120 ,
573
559
...prettierOptions ,
574
560
embeddedLanguageFormatting : "off" ,
575
561
parser : "markdown" ,
@@ -590,7 +576,6 @@ export async function formatters(
590
576
"format/prettier" : [
591
577
"error" ,
592
578
{
593
- printWidth : 120 ,
594
579
...prettierOptions ,
595
580
embeddedLanguageFormatting : "off" ,
596
581
parser : "slidev" ,
0 commit comments