pre-commit hook fail on template graphql with addmodule
See original GitHub issueWith the latest in master, if you do yarn cli addmodule testmod
, git add -A
, and then git commit
the pre-commit hook fails because of the empty graphql files with an error like below:
$ git commit
husky > npm run -s precommit (node v6.11.3)
Running tasks for *.{js,jsx,json} [started]
Running tasks for *.graphql [started]
eslint --fix [started]
prettier --parser graphql --write [started]
prettier --parser graphql --write [failed]
→ × prettier --parser graphql --write found some errors. Please fix them and try committing again.
[error] src\client\modules\testmod\graphql\TestmodQuery.graphql: SyntaxError: Syntax Error GraphQL request (2:1) Unexpected <EOF>
[error]
[error] 1: # GraphQL queries
[error] 2:
[error] ^
[error] (2:1)
[error] 1 | # GraphQL queries
[error] > 2 |
[error] | ^
Running tasks for *.graphql [failed]
→ × prettier --parser graphql --write found some errors. Please fix them and try committing again.
[error] src\client\modules\testmod\graphql\TestmodQuery.graphql: SyntaxError: Syntax Error GraphQL request (2:1) Unexpected <EOF>
[error]
[error] 1: # GraphQL queries
[error] 2:
[error] ^
[error] (2:1)
[error] 1 | # GraphQL queries
[error] > 2 |
[error] | ^
eslint --fix [completed]
git add [started]
git add [completed]
Running tasks for *.{js,jsx,json} [completed]
× prettier --parser graphql --write found some errors. Please fix them and try committing again.
[error] src\client\modules\testmod\graphql\TestmodQuery.graphql: SyntaxError: Syntax Error GraphQL request (2:1) Unexpected <EOF>
[error]
[error] 1: # GraphQL queries
[error] 2:
[error] ^
[error] (2:1)
[error] 1 | # GraphQL queries
[error] > 2 |
[error] | ^
husky > pre-commit hook failed (add --no-verify to bypass)
I notice that similarly empty files do not throw this error for previous modules I created, though the new files seem to have “Query” in the filename so I presume some changes have been made?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Graphql versions · Issue #605 · sysgears/apollo-universal-starter-kit ...
The yarn.lock file has two graphql versions in it. The latest dependencies are causing my ... pre-commit hook fail on template graphql with...
Read more >black as pre-commit hook always fails my commits
What actually happens when I stage a (non-black-compliant) file and try to commit: Black goes ahead and modifies the file to make it...
Read more >Supported hooks - pre-commit
check-autopkg-recipe-list - This hook checks AutoPkg recipe lists (in txt, plist, yaml, or json format) for common issues. check-autopkg-recipes - This hook ......
Read more >Changelog - AWS Lambda Powertools for Python
ci: add workflow to suggest splitting large PRs (#1480); ci: add linter for GitHub Actions as pre-commit hook (#1479); ci: remove dangling debug...
Read more >Jest mock custom hook - Caritas Castellaneta
There are two components, a ParentComponent and a ChildComponent. Jest mock a fetch function from a connected component. expect.
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 FreeTop 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
Top GitHub Comments
Hi everyone. I am closing this issue, because the pull request https://github.com/sysgears/apollo-universal-starter-kit/pull/847 updated the CLI. And now after creating the new module You can commit and run the tests without any errors.
@H1net We have public wiki now, editable by anyone, we can document quirks there, should be easy now: https://github.com/sysgears/apollo-universal-starter-kit/wiki