-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): avoid
require
in prettier config during tailwind setup (#…
…10183) **Problem** With the recent switch to prettier v3 we have some new constraints on how we write our prettier config. One of these is the need to avoid `require` statements. The tailwind setup command in the CLI was adding this to the config file and causing runtime errors on commands like lint. **Changes** 1. Switches the setup command to simply insert the name of the plugin. See [here](https://prettier.io/docs/en/plugins#using-plugins) as to guidance on this. > Strings provided to plugins are ultimately passed to [import() expression](https://nodejs.org/api/esm.html#import-expressions), so you can provide a module/package name, a path, or anything else import() takes. 2. Regenerated the test project fixture and in so doing it bumped the `prettier-plugin-tailwindcss` version. You can also see some formatting for graphql tags have altered as a result of the upgrades. --------- Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>
- Loading branch information
1 parent
96343bd
commit 2690968
Showing
11 changed files
with
80 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- fix(cli): avoid `require` in prettier config during tailwind setup (#10183) by @Josh-Walker-GM | ||
|
||
With the recent switch to prettier v3 we are no longer able to use `require` within the `prettier.config.js` | ||
config file. This change prevents the tailwind setup CLI command from adding a require statement when it adds | ||
the `'prettier-plugin-tailwindcss'` plugin and instead it simply inserts the plugin name as a string. This | ||
fixes commands such as `yarn rw lint` which would have failed in the presence of such a `require` statement. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.