Skip to content

Commit

Permalink
Disable warnings when running in a GitHub Actions workflow (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 8, 2020
1 parent 97070f0 commit 7731ea1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli-main.js
Expand Up @@ -135,6 +135,10 @@ if (typeof options.space === 'string') {
}
}

if (process.env.GITHUB_ACTIONS) {
options.quiet = true;
}

const log = report => {
const reporter = options.reporter || process.env.GITHUB_ACTIONS ? xo.getFormatter(options.reporter || 'compact') : formatterPretty;
process.stdout.write(reporter(report.results));
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Expand Up @@ -293,6 +293,10 @@ XO will handle the [@typescript-eslint/parser `project` option](https://github.c

See [eslint-config-xo-flow#use-with-xo](https://github.com/xojs/eslint-config-xo-flow#use-with-xo)

## GitHub Actions

XO uses a different formatter when running in a GitHub Actions workflow to be able to get [inline annotations](https://developer.github.com/changes/2019-09-06-more-check-annotations-shown-in-files-changed-tab/). XO also disables warnings here.

## Config Overrides

XO makes it easy to override configs for specific files. The `overrides` property must be an array of override objects. Each override object must contain a `files` property which is a glob string, or an array of glob strings, relative to the config file. The remaining properties are identical to those described above, and will override the settings of the base config. If multiple override configs match the same file, each matching override is applied in the order it appears in the array. This means the last override in the array takes precedence over earlier ones. Consider the following example:
Expand Down

0 comments on commit 7731ea1

Please sign in to comment.