# Prettier

Remaining consistent isn't easy when the team grows. A lot of code formatting issues brought up by the linter can be fixed automatically. That's Prettier.

```
$ yarn add prettier
```

Change `index.ts` to following code:

{% code title="index.ts" %}

```typescript
const printFizz = number => {
        if (!Boolean(number % 3)) 
        {
return "fizz";
    }
};

```

{% endcode %}

then run

```
$ prettier --write packages/api/index.ts
```

The file has been formatted correctly:

{% code title="index.ts" %}

```typescript
const printFizz = number => {
    if (!Boolean(number % 3)) {
        return "fizz";
    }
};
```

{% endcode %}

### Avoid TSLint conflict

```
yarn add tslint-config-prettier -D
```

Update `tslint.json`

{% code title="tslint.json" %}

```typescript
{
  "defaultSeverity": "error",
  "extends": ["tslint:recommended", "tslint-config-prettier"],
  "jsRules": {},
  "rules": {},
  "rulesDirectory": []
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorial.specian.co.uk/project-setup/prettier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
