2024-11-07 13:07:02 +01:00
|
|
|
# NodeJS {#ch-quirks-nodejs}
|
2024-05-23 03:32:12 +02:00
|
|
|
|
|
|
|
## eslint-plugin-prettier {#sec-eslint-plugin-prettier}
|
|
|
|
|
2024-11-07 13:07:02 +01:00
|
|
|
When working with NodeJS, everything works as expected, but some projects have
|
|
|
|
settings that can fool nvf.
|
2024-05-23 03:32:12 +02:00
|
|
|
|
2024-11-07 13:07:02 +01:00
|
|
|
If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar
|
|
|
|
is included, you might get a situation where your eslint configuration diagnoses
|
|
|
|
your formatting according to its own config (usually `.eslintrc.js`).
|
2024-05-23 03:32:12 +02:00
|
|
|
|
|
|
|
The issue there is your formatting is made via prettierd.
|
|
|
|
|
2024-11-26 08:36:39 +01:00
|
|
|
This results in auto-formatting relying on your prettier config, while your
|
2024-11-07 13:07:02 +01:00
|
|
|
eslint config diagnoses formatting
|
|
|
|
[which it's not supposed to](https://prettier.io/docs/en/comparison.html))
|
2024-05-23 03:32:12 +02:00
|
|
|
|
2024-11-07 13:07:02 +01:00
|
|
|
In the end, you get discrepancies between what your editor does and what it
|
|
|
|
wants.
|
2024-05-23 03:32:12 +02:00
|
|
|
|
|
|
|
Solutions are:
|
|
|
|
|
|
|
|
1. Don't add a formatting config to eslint, and separate prettier and eslint.
|
|
|
|
2. PR this repo to add an ESLint formatter and configure nvf to use it.
|