How to add tslint-disable and prettier-ignore both for a single line

242 Views Asked by At

How can I disable tslint/eslint and ignore the prettier for a single line, both rules at the same line?

I want to align all the properties of the object using vscode plugin but prettier reformats it and the whitespace is removed by the eslint rule.

const user = {
  id: 123456,
  name: "John Doe",
  user_email_id: "[email protected]",
};

I want the output as follows:

const user = {
  id            : 123456,
  name          : "John Doe",
  user_email_id : "[email protected]",
};
1

There are 1 best solutions below

0
Suhail Akhtar On BEST ANSWER

Tslint/eslint and prettier can be disabled by the following rule to align the properties:

/* prettier-ignore */ // tslint:disable typedef-whitespace
const user = {
  id            : 123456,
  name          : "John Doe",
  user_email_id : "[email protected]",
};