Support projects without a 'package.json'
bryant-finney opened this issue · comments
Bryant Finney commented
Problem Statement
prettier supports many languages other than JavaScript (YAML, Markdown, JSON, HTML, etc.). Integrations with tools such as pre-commit
or vscode
make it convenient to use prettier
in repositories that don't depend on node.js
or define a package.json
.
However, this action fails if package.json
does not exist in the repository.
Example
See bryant-finney/demo-reviewdog-action-prettier#1:
- the first job in its
🌈 Prettier
workflow fails to add comments to the PR:npm ERR! enoent ENOENT: no such file or directory
,open '/home/runner/work/demo-reviewdog-action-prettier/demo-reviewdog-action-prettier/package.json'
- the second job validates a fix: bryant-finney/demo-reviewdog-action-prettier#1 (comment)