Comments (4)
Interesting. pretty-quick
only has a peerDependency
on prettier
and your version 1.10.2
matches it. pretty-quick
does have a devDependency
of 1.18.2
on prettier
here which does match what you're seeing.
Could you change the console log you inserted to show require.resolve('prettier')
instead, to confirm the path that prettier
is being loaded from?
from pretty-quick.
It gets resolved to this: node_modules/prettier/index.js
, which is indeed version 1.18.2
.
$ cat node_modules/prettier/index.js | grep version | head -n 1
var version$1 = "1.18.2";
And then I checked what version the scripts are using:
$ cat $(yarn bin)/prettier | grep version | head -n 1
var version$1 = "1.10.2";
It seems more of yarn/npm problem, in the way dependencies are resolved.
The only solution that occurs to me is to use execa to run prettier on pretty-quick side . Instead of using it as a library. But personally I don't like the idea, the library is handier to use.
~/p/cw-buyer master*
$ cat with-execa.js
const execa = require('execa')
console.log(execa.sync('prettier', ['--version']).stdout)
~/p/cw-buyer master*
$ node with-execa.js
1.10.2
If you think this is something that shouldn't be solved from pretty-quick side then let's close the issue, that would be totally fine π (I should be using an updated version of prettier anyway.)
But if you do want to solve it from pretty-quick side I'm open to collaborate on implementation.
from pretty-quick.
Where does ls -l $(yarn bin)/prettier
link to then?
Don't want to switch to sub-processes in the interest of being quick π, so I will close this issue, but still interested to see where your prettier
is actually being resolved from!
from pretty-quick.
Makes sense.
It didn't occur to me to check were prettier was linked to.
We have it installed as a dependency of a toolbox ("cw-sdk-js") so it comes from there.
~/projects/cw-buyer/node_modules/.bin/prettier -> ../cw-sdk-js/node_modules/prettier/bin-prettier.js
from pretty-quick.
Related Issues (20)
- `pretty-quick --staged` in pre-commit has odd behavior in conjunction with `git commit PATHβ¦`
- Round brackets pattern not working HOT 1
- pretty-quick does not find any changed file HOT 15
- git diff causing error in github action HOT 1
- Fix Readme for Husky 6.0.0 HOT 2
- pretty-quick does not work when "type": "module" is declared in package.json in a TypeScript project HOT 1
- Use newest prettier
- Executing pretty-quick in git worktree cannot detect scm HOT 2
- Ignore errors with husky precommit hook HOT 4
- Ignoring lines in html files doesnt work <!-- prettier-ignore --> HOT 1
- How to format all file?
- Format single quote to double when I commit HOT 1
- I would like to see the fixes applied using pretty-quick
- Bug: an invalid branch name does not produce a failure
- SyntaxError: Unexpected token (11:16) HOT 1
- Not working with npx & husky pre-commit hook HOT 1
- pretty-quick will break with prettier v3 HOT 32
- SyntaxError: Unexpected token ? HOT 3
- prettier.resolveConfig.sync is not a function HOT 6
- -c
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pretty-quick.