Add expected prettier version in config
See original GitHub issueHi,
I think it would be nice to be able to define a version in .prettierrc.
The idea is that if you set version= "^1.6.1"
in .prettierrc, running Prettier 1.5 on the project would fail.
This would prevent other team members with globally installed old versions of prettier to reformat the code in “the old way” when rules of prettier change across versions (see for example JSX formatting changes between 1.5 => 1.6)
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Options - Prettier
Ensure Prettier's endOfLine option is set to lf (this is a default value since v2.0.0) · Configure a pre-commit hook that will run...
Read more >How to configure Prettier and VSCode
You can configure JavaScript code auto-formatting with Prettier to work per-project. This allows you to get a consistent formatting without ...
Read more >How do you reenable esLint squiggly lines after adding ...
I was able to find an answer to my query. In short, the configuration works despite my console.log test appearing to fail.
Read more >eslint-config-prettier-standard
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >Prettier, ESLint and Typescript
At the time of this writing, Prettier is in version 2.4.1, ... Add the configuration file to the root of your project (you...
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
@lydell
That was my understanding as well
I guess this could also be solved in a general way by using one of those automatic git hook installers adding a “run
npm install
/yarn
if package.json or package-lock.json/yarn.lock has changed aftergit pull
”. That would also protect againsteslint --fix
resulting in the same issue.