Skip to content

Add VSCode settings#15885

Merged
fisker merged 15 commits intoprettier:mainfrom
fisker:vscode-settings
Jan 8, 2024
Merged

Add VSCode settings#15885
fisker merged 15 commits intoprettier:mainfrom
fisker:vscode-settings

Conversation

@fisker
Copy link
Copy Markdown
Member

@fisker fisker commented Jan 6, 2024

Description

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@fisker fisker marked this pull request as ready for review January 6, 2024 17:14
package.json Outdated
"gen:changelog": "node ./scripts/generate-changelog.js",
"debug": "node bin/prettier.js --ignore-path=.prettierignore"
"debug": "node bin/prettier.js --ignore-path=.prettierignore",
"postinstall": "node -e \"try{fs.existsSync('.vscode/settings.json')||fs.writeFileSync('.vscode/settings.json',fs.readFileSync('.vscode/settings.example.json'))}catch(_){}\""
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Turns out we can't use an extra script file to copy the file, because this will run when yarn install prettier@prettier/prettier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any reason we don't use prepare?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yarn>=2 don't run prepare.

Copy link
Copy Markdown
Contributor

@liuxingbaoyu liuxingbaoyu Jan 8, 2024

Choose a reason for hiding this comment

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

I am surprised, which means that the prepare in the Babel repo did not work as expected.
But when we use Yarn 4, maybe we can use it to complete this.
https://yarnpkg.com/configuration/yarnrc#enableConstraintschecks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't understand how enableConstraintschecks can do this. But yarn plugin should be able to do it.

Copy link
Copy Markdown
Contributor

@liuxingbaoyu liuxingbaoyu Jan 8, 2024

Choose a reason for hiding this comment

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

When EnableConstraintschecks is true, Yarn runs every time yarn.config.cjs.
https://github.com/babel/babel/blob/main/yarn.config.cjs

Copy link
Copy Markdown
Member Author

@fisker fisker Jan 8, 2024

Choose a reason for hiding this comment

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

I'm going to use yarn plugin instead. Since we don't want add yarn.config.cjs for this.

@fisker fisker merged commit 81efe72 into prettier:main Jan 8, 2024
@fisker fisker deleted the vscode-settings branch January 8, 2024 09:07
medikoo pushed a commit to medikoo/prettier-elastic that referenced this pull request Feb 17, 2024
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.

2 participants