File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable unicorn/filename-case */
22
3- import { promises as fsp } from 'fs'
3+ import fs from 'fs/promises '
44
55import {
66 type FileInfoOptions ,
@@ -9,14 +9,16 @@ import {
99} from 'prettier'
1010
1111export default ( resolveConfig ?: boolean ) => async ( file : string ) => {
12- const stat = await fsp . stat ( file ) . catch ( _error => null )
12+ const stat = await fs . stat ( file ) . catch ( _error => null )
1313 /* If file exists but is actually a directory, getFileInfo might end up trying
1414 * to open it and read it as a file, so let's not let that happen. On the
1515 * other hand, the tests depend on our not failing out with files that don't
1616 * exist, so permit nonexistent files to go through (they appear to be
1717 * detected by suffix, so never get read).
1818 */
19- if ( stat ?. isDirectory ( ) ) return false
19+ if ( stat ?. isDirectory ( ) ) {
20+ return false
21+ }
2022 const config = ( await prettierResolveConfig ( file , {
2123 editorconfig : true ,
2224 } ) ) as FileInfoOptions
You can’t perform that action at this time.
0 commit comments