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

Not working with prettier-ignore #297

Open
1 task
justingolden21 opened this issue Jun 7, 2024 · 2 comments
Open
1 task

Not working with prettier-ignore #297

justingolden21 opened this issue Jun 7, 2024 · 2 comments

Comments

@justingolden21
Copy link

Your Environment

  • Prettier version:
    "prettier": "^3.1.1",
    "prettier-plugin-organize-imports": "^3.2.4",
    "prettier-plugin-svelte": "^3.1.2",
    "prettier-plugin-tailwindcss": "^0.5.10",
  • node version: node 20.11.0
  • package manager: pnpm 8.14.1
  • IDE: VS Code

Describe the bug

When I add a // prettier-ignore comment above an export, then it still underlines red and formats it, just in a different format

To Reproduce

I try to export functions like so:

// prettier-ignore
export {
	getCurrentTimestampSeconds,
	getCurrentTimestampMilliseconds,
	timestampToDate,
	timestampToDateUTC,
	dateToTimestamp,
	msToUnits,
	getTimestampDiff,
	unitsToString
};

Expected behavior

Because I have a // prettier-ignore comment, there should be no underline

Screenshots, code sample, etc

Red Underline

image

Error Message

image

image

Incorrect result after selecting fix the first problem

image

Incorrectly formatted after alt+shift+F

image

// prettier-ignore
export {
dateToTimestamp,getCurrentTimestampMilliseconds,getCurrentTimestampSeconds,getTimestampDiff,msToUnits,timestampToDate,

timestampToDateUTC,unitsToString

};
prettier.export.ignore.bug.mp4

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

{
	"bracketSameLine": true,
	"printWidth": 100,
	"quoteProps": "consistent",
	"singleQuote": true,
	"trailingComma": "none",
	"useTabs": true,
	"endOfLine": "crlf",
	"plugins": [
		"prettier-plugin-tailwindcss",
		"prettier-plugin-organize-imports",
		"prettier-plugin-svelte"
	],
	"organizeImportsSkipDestructiveCodeActions": true
}

Error log

N/A

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

  • I'm willing to fix this bug 🥇
@discoverlance-com
Copy link

Any updates on this?

@yordis
Copy link

yordis commented Sep 27, 2024

Are you sure you are using this plugin, based on your config you are using prettier-plugin-organize-imports package which is different

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

3 participants