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

Prettier check fails on 5.2.1 with a commented import #338

Open
1 task
tiagojufr opened this issue Dec 19, 2024 · 0 comments
Open
1 task

Prettier check fails on 5.2.1 with a commented import #338

tiagojufr opened this issue Dec 19, 2024 · 0 comments

Comments

@tiagojufr
Copy link

tiagojufr commented Dec 19, 2024

Your Environment

  • Prettier version: 3.4.2
  • node version: 20.12.0
  • package manager: [email protected]
  • IDE: VScode

Describe the bug

Having a commented out import causes prettier --check to fail after upgrading @trivago/prettier-plugin-sort-imports to 5.2.1. This worked fine in 4.3.0
Example code:

import {
  a,
  b, // c,
  d
} from './imports.mjs';

To Reproduce

I have a Code Sandbox with a repro. Just follow the instructions in the README.md file.

Expected behavior

I would expect prettier --check to pass as it did in v4.

Screenshots, code sample, etc

See Code Sandbox link above.

Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)

See .prettierrc.json in the Code Sandbox:

{
  "bracketSpacing": true,
  "singleQuote": true,
  "trailingComma": "none",
  "endOfLine": "auto",
  "importOrder": ["<THIRD_PARTY_MODULES>", "^@", "^\\.\\./", "^\\./", "^\\."],
  "importOrderSortSpecifiers": true,
  "importOrderCaseInsensitive": true,
  "plugins": ["@trivago/prettier-plugin-sort-imports"]
}

Error log

$ prettier --check .
Checking formatting...
[warn] index.mjs
[warn] Code style issues found in the above file. Run Prettier with --write to fix.
error Command failed with exit code 1.

Contribute to @trivago/prettier-plugin-sort-imports

  • I'm willing to fix this bug 🥇
@tiagojufr tiagojufr changed the title Prettier check fails on 5.2.0 with a commented import Prettier check fails on 5.2.1 with a commented import Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant