@@ -6,13 +6,13 @@ import process from "node:process";
66import Cache from "./cache.js" ;
77import { getEditorConfigsMap , getEditorConfigResolved , getEditorConfigFormatOptions } from "./config_editorconfig.js" ;
88import { getIgnoresContentMap , getIgnoreBys , getIgnoreResolved } from "./config_ignore.js" ;
9- import { Loaders , getPrettierConfigsMap , getPrettierConfigResolved } from "./config_prettier.js" ;
9+ import { Loaders , File2Loader , getPrettierConfigsMap , getPrettierConfigResolved } from "./config_prettier.js" ;
1010import { PRETTIER_VERSION , CLI_VERSION } from "./constants.js" ;
1111import Known from "./known.js" ;
1212import Logger from "./logger.js" ;
1313import { makePrettier } from "./prettier.js" ;
1414import { castArray , getExpandedFoldersPaths , getFoldersChildrenPaths , getPluginsVersions , getProjectPath , getStdin , getTargetsPaths } from "./utils.js" ;
15- import { fastRelativePath , isNull , isString , isUndefined , negate , pluralize , trimFinalNewline , uniq } from "./utils.js" ;
15+ import { fastRelativePath , isNull , isString , isUndefined , negate , pluralize , trimFinalNewline , uniq , without } from "./utils.js" ;
1616import type { FormatOptions , Options , PluginsOptions } from "./types.js" ;
1717
1818async function run ( options : Options , pluginsDefaultOptions : PluginsOptions , pluginsCustomOptions : PluginsOptions ) : Promise < void > {
@@ -76,7 +76,7 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
7676
7777 const editorConfigNames = options . editorConfig ? [ ".editorconfig" ] . filter ( Known . hasFileName ) : [ ] ;
7878 const ignoreNames = options . ignore ? [ ".gitignore" , ".prettierignore" ] . filter ( Known . hasFileName ) : [ ] ;
79- const prettierConfigNames = options . config ? [ "package.json" , ".prettierrc" , ".prettierrc.yml" , ".prettierrc.yaml" , ".prettierrc.json" , ".prettierrc.jsonc" , ".prettierrc.json5" , ".prettierrc.js" , "prettier.config.js" , ".prettierrc.cjs" , "prettier.config.cjs" , ".prettierrc.mjs" , "prettier.config.mjs" ] . filter ( Known . hasFileName ) : [ ] ; // prettier-ignore
79+ const prettierConfigNames = options . config ? without ( Object . keys ( File2Loader ) , [ "default" ] ) . filter ( Known . hasFileName ) : [ ] ;
8080
8181 const fileNames2parentPaths = ( names : string [ ] ) => names . flatMap ( ( name ) => filesNamesToPaths [ name ] ?. map ( path . dirname ) || [ ] ) ;
8282 const editorConfigPaths = uniq ( [ ...fileNames2parentPaths ( editorConfigNames ) , rootPath , ...foldersExtraPaths ] ) ;
0 commit comments