prettier / pre-commit Goto Github PK
View Code? Open in Web Editor NEWMirror of Prettier package for pre-commit.
Mirror of Prettier package for pre-commit.
I'm trying to use prettier-plugin-svelte
, but I think it's detected from being installed rather than in package.json
(?) and so since there's no (good) way to put it in the pre-commit
environment, it isn't picked up?
Hi, I started getting this error with the new version (I think since 2.1). I'm using Ubuntu
**> pre-commit run -a**
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check for added large files..............................................Passed
Check Yaml...............................................................Passed
black....................................................................Passed
isort....................................................................Passed
flake8...................................................................Passed
prettier.................................................................Failed
- hook id: prettier
- exit code: 1
/home/matias.thayer/.cache/pre-commit/repotvnwyngx/node_env-system/lib/node_modules/prettier/third-party.js:9871
for await (const place of this.config.searchPlaces) {
^^^^^
SyntaxError: Unexpected reserved word
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/matias.thayer/.cache/pre-commit/repotvnwyngx/node_env-system/lib/node_modules/prettier/index.js:16551:18)
/home/matias.thayer/.cache/pre-commit/repotvnwyngx/node_env-system/lib/node_modules/prettier/third-party.js:9871
for await (const place of this.config.searchPlaces) {
^^^^^
SyntaxError: Unexpected reserved word
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/matias.thayer/.cache/pre-commit/repotvnwyngx/node_env-system/lib/node_modules/prettier/index.js:16551:18)
/home/matias.thayer/.cache/pre-commit/repotvnwyngx/node_env-system/lib/node_modules/prettier/third-party.js:9871
for await (const place of this.config.searchPlaces) {
^^^^^
And there are more blocks of errors about " Unexpected reserved word"
Any idea why?
Thanks
[INFO] Initializing environment for https://github.com/prettier/pre-commit.
[INFO] Initializing environment for https://github.com/prettier/pre-commit:[email protected].
[INFO] Installing environment for https://github.com/prettier/pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/graingert/.cache/pre-commit/repoe21z9_lv/node_env-system/bin/node', '/usr/bin/npm', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
expected return code: 0
stdout: (none)
stderr:
npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
npm ERR! code ETARGET
npm ERR! notarget No matching version found for [email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'repoe21z9_lv'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /home/graingert/.npm/_logs/2020-11-15T11_50_11_298Z-debug.log
this should ease migration from the original prettier/prettier repo:
pre-commit/.pre-commit-hooks.yaml
Lines 4 to 7 in 42a7d8b
vs
without --write
, prettier produces not so useful output (lots of file contents)
pre-commit works best with tags, branches will produce warnings/errors in a future version of pre-commit
thanks!
Hi,
I'm considering using this instead of the prettier repository, but I'm having my doubts about it because there are no tags at all to refer to a stable version. Instead of that there are 103 branches. I don't see the point of using a reference to a branch like v2.1.2
because any commit may surprisingly change the behaviour or introduce regressions.
Is there a reason behind that?
All the release tags are gone.
This completely brakes existing integrations. It also breaks pre-commit autoupdate
. Since there are no tags, the latest commit is picked up as the latest version:
- - repo: https://github.com/prettier/prettier
- rev: v2.1.2
+ - repo: https://github.com/prettier/pre-commit
+ rev: 413fd9da8e03249b74acf8543567e5debbad8bfa
I moved to using the pre-commit hook recently since prettier/prettier
broke due to npm
changes, but it seems this mirror is not broken too.
Otherwise pre-commit
fails:
$ pre-commit run
An error has occurred: InvalidConfigError:
==> File .pre-commit-config.yaml
==> At Config()
==> At key: repos
==> At Repository(repo='https://github.com/prettier/pre-commit')
=====> Missing required key: rev
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.