Disable prettier for a single file

Hamid Shoja picture Hamid Shoja · Jan 23, 2020 · Viewed 18.4k times · Source

I need to disable prettier for single file (API URLS file) in my project in Vs-code. actually I need each API and its URL be in one line , but prettier break them in two lines.

before

export const GET_SEARCH_TEACHERS = params => myexampleFunction_app_base(`teachers/search/${params.search}`);

after

export const GET_SEARCH_TEACHERS = params =>
myexampleFunction_app_base(`teachers/search/${params.search}`);

Answer

Zunaib Imtiaz picture Zunaib Imtiaz · Jan 23, 2020

If you want a certain file in a repo to never be formatted by prettier, you can add it to a .prettierignore file: Disable Prettier for one file