Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRA 5 installs prettier-plugin-tailwindcss which changes prettier behavior to sort classNames (also it's unlicensed) #12044

Open
MartijnHols opened this issue Feb 10, 2022 · 0 comments · May be fixed by #12046

Comments

@MartijnHols
Copy link

Describe the bug

After installing CRA5, prettier started reporting errors for class names which aren't sorted. Upon inspection, I found this to be caused by the install of prettier-plugin-tailwindcss. This lib is undesirable as it alters the default Prettier config, and because it's installed as a plugin unconfigurable.

In addition, this library is unlicensed, so using it is suspicious legally.
In addition, this library is uglified, so its published code can hardly be reviewed and may be harmful.

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

I searched the entire repo for mentions of the plugin, and did not find anything relevant.

Environment

Environment Info:

current version of create-react-app: 5.0.0
running from /Users/martijnhols/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app

System:
OS: macOS 11.6.2
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
Yarn: 1.22.17 - ~/.yarn/bin/yarn
npm: 7.24.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
Browsers:
Chrome: 98.0.4758.80
Edge: Not Found
Firefox: 88.0
Safari: 15.2
npmPackages:
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-scripts: ^5.0.0 => 5.0.0
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

  1. Install CRA 5
  2. install prettier
  3. Write any kind of code with classNames e.g. table table-condensed which is already sorted as desired
  4. find prettier to complain about the className order while it works fine in CRA4 or any project with standard prettier

Expected behavior

I would expect CRA5 not to alter default Prettier config.

Actual behavior

The prettier-plugin-tailwindcss plugin is installed and alters Prettier config.

MartijnHols added a commit to MartijnHols/create-react-app that referenced this issue Feb 10, 2022
Fixes facebook#12044

Installing tailwindcss comes with a bunch of junk most people don't need, and at least prettier-plugin-tailwindcss but possibly more subdependecies are unlicensed which makes usage troublesome.
@MartijnHols MartijnHols linked a pull request Feb 10, 2022 that will close this issue
MartijnHols added a commit to MartijnHols/create-react-app that referenced this issue Feb 10, 2022
Fixes facebook#12044

Installing tailwindcss comes with a bunch of junk most people don't need, and at least prettier-plugin-tailwindcss but possibly more subdependecies are unlicensed which makes usage troublesome.
MartijnHols added a commit to MartijnHols/create-react-app that referenced this issue Feb 10, 2022
Fixes facebook#12044

Installing tailwindcss comes with a bunch of junk most people don't need, and at least prettier-plugin-tailwindcss but possibly more subdependecies are unlicensed which makes usage troublesome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant