File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 1414
1515import fs from "fs/promises" ;
1616
17- export const ignores = await fs . readFile ( ".gitignore" , "utf-8" ) . then ( ( v ) => {
18- return v
19- . split ( "\n" )
20- . map ( ( v ) => v . trim ( ) )
21- . filter ( ( v ) => ! v . startsWith ( "#" ) && ! v . startsWith ( "!" ) )
22- . map ( ( v ) => v . replace ( / ^ \/ / , "" ) )
23- . filter ( ( v ) => v !== "" ) ;
24- } ) ;
17+ export const ignores = await fs
18+ . readFile ( ".gitignore" , "utf-8" )
19+ . then ( ( v ) => {
20+ return v
21+ . split ( "\n" )
22+ . map ( ( v ) => v . trim ( ) )
23+ . filter ( ( v ) => ! v . startsWith ( "#" ) && ! v . startsWith ( "!" ) )
24+ . map ( ( v ) => v . replace ( / ^ \/ / , "" ) )
25+ . filter ( ( v ) => v !== "" ) ;
26+ } ) ;
Original file line number Diff line number Diff line change 1- /* eslint-disable @susisu/safe- typescript/no-type-assertion */
1+ /* eslint-disable @typescript-eslint /no-unsafe-return */
22import fs from "fs/promises" ;
33import type { JsonValue } from "type-fest" ;
44
5- export function readJsonFile ( path : string ) {
5+ export function readJsonFile ( path : string ) : Promise < JsonValue > {
66 return fs . readFile ( path , "utf-8" )
7- . then ( ( v ) => JSON . parse ( v ) as JsonValue ) ;
7+ . then ( ( v ) => JSON . parse ( v ) ) ;
88}
99
1010export function writeJsonFile (
You can’t perform that action at this time.
0 commit comments