I'm getting a Prettier error related to tabs vs. spaces. How do I configure Prettier to use spaces?

Responsive Ad Header

Question

Grade: Education Subject: Support
I'm getting a Prettier error related to tabs vs. spaces. How do I configure Prettier to use spaces?
Asked by:
99 Viewed 99 Answers

Answer (99)

Best Answer
(199)
In your `.prettierrc` file, set `tabWidth` to the number of spaces you want to use (e.g., `tabWidth: 2`) and `useTabs` to `false`. This forces Prettier to use spaces instead of tabs for indentation.