question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to turn off prettier

See original GitHub issue

Add the ability to turn off prettier, specifically in generators. Currently, prettier is installed automatically with npm 7/8, which there is no way to completely turn it off.

Description

For teams that dislike prettier, it would be nice to be able to turn it completely off.

Motivation

Prettier can cause headaches in larger teams and unnecessary code changes to review.

Suggested Implementation

Take into account the .prettierignore for all prettier tasks.

Alternate Implementations

Either add a setting in nx.json, or change prettier to be optionalDependencies and checking if installed before using.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
nawilsoncommented, Feb 9, 2022

Hi,

This is still an issue in NX version 13.8.0. With the prettier packages removed (prettier, eslint-config-prettier, eslint-plugin-prettier), eslint fails with the following error:

UnhandledPromiseRejectionWarning:` Error: Failed to load config "prettier" to extend from.
Referenced from: .../node_modules/@nrwl/eslint-plugin-nx/src/index.js
    at configInvalidError (.../node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2596:9)

I had to remove prettier from the extends attribute of the default eslint configs in:

@nrwl/eslint-plugin-nx/src/configs/javascript.js
@nrwl/eslint-plugin-nx/src/configs/typescript.js
5reactions
Rugshtynecommented, Mar 2, 2022

This is an issue. We are not using prettier though the eslint-plugin-nx wants to extend the config of it. Please decouple the extension in the configs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable prettier in VSCode for a specific project?
Just create a .prettierignore file in the project with **. The entire codebase will be ignored for Prettier plugin.
Read more >
Disabling languages for Prettier (in VScode) | Zell Liew
Enabling Prettier Globally but disabling it in specific languages ... We can enable Prettier globally with the editor.defaultFormatter property. " ...
Read more >
Ignoring Code - Prettier
Use .prettierignore to ignore (i.e. not reformat) certain files and folders completely. Use “prettier-ignore” comments to ignore parts of files.
Read more >
How to set up Prettier and automatic formatting on VS Code
You can do this on Windows by pressing both Ctrl and , . Click on the formatting section of the Text Editor tab...
Read more >
disable prettier vscode - Code Examples & Solutions For This ...
If you want to disable Prettier on a particular language you can either create a .prettierignore file or you can use VS Code's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found