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

Fixes resolveConfigFile usage for 3.1.1 #3335

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Fixes resolveConfigFile usage for 3.1.1 #3335

merged 2 commits into from
Mar 21, 2024

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Mar 9, 2024

Fixes #3235

  • Run tests
  • Update the CHANGELOG.md with a summary of your changes

@auto-assign auto-assign bot requested a review from ntotten March 9, 2024 17:05
// Avoid https://github.com/prettier/prettier/pull/15363
const isGte3_1_1 = semver.gte(prettierInstance.version, "3.1.1");
if (isGte3_1_1) {
return path.join(fileName, "tmp");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fisker fileName is opened project directory path. And it has temporary file name. Do you have a better plan?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a more random name, such as UUID, should be used?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use the real file path?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use the real file path?

Maybe it can be done, but I'm not familiar with prettier-vscode and don't know what the expected behavior is...
So I thought it would be quicker if we could take an approach like this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated to use noop.js instead of tmp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fisker ping

Copy link
Member

@fisker fisker Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with this, you can merge if you think it will work, but better wait for @ntotten ?

@sosukesuzuki sosukesuzuki merged commit 0016044 into main Mar 21, 2024
14 checks passed
@sosukesuzuki sosukesuzuki deleted the fix-3235 branch March 21, 2024 01:24
ntotten pushed a commit that referenced this pull request Mar 21, 2024
@Synweigh
Copy link

Having the same issue with prettier 2.5.0. Trying to format svelte.ts files and getting "Extension 'Prettier - Code formatter' is configured as formatter but it cannot format 'Svelte'-files. This is my package.json:
"prettier": "^3.2.5", "prettier-plugin-svelte": "^3.2.2", "prettier-plugin-tailwindcss": "^0.5.13",

@thebrandonlucas
Copy link

I'm also encountering this problem, with the same setup as @Synweigh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prettier-vscode does not work with plugins since prettier v3.1.1
5 participants