What's the difference between `.prettierrc` and `prettier.config.js`?

Question

Grade: Education Subject: Support
What's the difference between `.prettierrc` and `prettier.config.js`?
Asked by:
69 Viewed 69 Answers

Answer (69)

Best Answer
(251)
`.prettierrc` is a JSON file for simpler configurations. `prettier.config.js` is a JavaScript file that allows for more complex configurations, including dynamic options and plugins. `prettier.config.js` is generally preferred for advanced use cases.