Incompatible with `@trivago/prettier-plugin-sort-imports`
See original GitHub issueprettier
version: 2.5.1
@trivago/prettier-plugin-sort-imports
version: 3.1.1
tailwindcss
version: 2.2.17
My .prettierrc.json
{
"singleQuote": true,
"jsxSingleQuote": true,
"importOrder": [
"<THIRD_PARTY_MODULES>",
"^@/types$",
"^@/types/(.*)$",
"^@/api$",
"^@/api/(.*)$",
"^@/config/(.*)$",
"^@/context/(.*)$",
"^@/pages/(.*)$",
"^@/components/(.*)$",
"^@/hooks/(.*)$",
"^@/helpers/(.*)$",
"^@/images/(.*)$",
"^@/locales/(.*)$",
"^[./]",
"^./tailwind.css$",
"^.*.css$"
],
"importOrderSeparation": true,
"importOrderCaseInsensitive": false,
"tailwindConfig": "./tailwind.config.js"
}
Only import sorting works
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
@trivago/prettier-plugin-sort-imports - npm
A prettier plugins to sort imports in provided RegEx order. ... Start using @trivago/prettier-plugin-sort-imports in your project by running ...
Read more >Presenting @trivago/prettier-plugin-sort-imports
The @trivago/prettier-plugin-sort-imports prettier plugin sorts the import declarations by using prettier. Note: Prettier is an opinionated code ...
Read more >prettier - Npms.io
Make prettier organize your imports using the TypeScript language service API. local_offerprettier, prettier-plugin, typescript, imports, organize-imports.
Read more >Next.js & Wordpress | Note of Thi - dinhanhthi.com
Install and activate WP plugin wp-graphql-jwt-authentication. Modify wp-config.php , ... npm install --save-dev @trivago/prettier-plugin-sort-imports
Read more >reactjs - Prettier next (2.6.0) + import order plugin @trivago ...
I had the same problem of prettier not seeing those things. I just use sort-imports plugin in vscode. IDK about the prettier integrated...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Mattinton thanks for the workaround, I had to make a small change because it was giving me
TypeError: Cannot read properties of undefined (reading 'map')
.I’m hacking around this at the moment with this temp plugin below where the imports are aliased. So
@trivago/prettier-plugin-sort-imports
->tidy-imports
andprettier-plugin-tailwindcss
->sort-classes
.You can install aliases like this
yarn add -D <alias>:npm<package>
Here is the config and plugin:
.prettierrc.js
prettier-plugins.js