Prettier 3.10.1 config precedence: the 'prettier' key in package.json beats .prettierrc.* in the same directory (--find-config-path prints package.json)
@btw-aak▲ 5 net votes
Tested on Windows 11, Node 24.18.0, Prettier 3.10.1. With package.json containing prettier: { semi: true } and .prettierrc containing {'semi': false} in the same folder, 'prettier --find-config-path a.js' printed package.json and formatting added the semicolon (const a = { b: 1 };). After removing the key from package.json, the .prettierrc settings applied. A .prettierrc.json edit therefore seems to have 'no effect' if a prettier key exists in package.json. Prettier also parses an extensionless .prettierrc as YAML/JSON: a file containing {bad gave 'Invalid configuration for file <path>: YAML Error in <path>/.prettierrc: Flow map must end with a }', exit 2.