Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use XO with review dog? #1577

Open
tomerh2001 opened this issue Sep 25, 2023 · 1 comment
Open

Can I use XO with review dog? #1577

tomerh2001 opened this issue Sep 25, 2023 · 1 comment

Comments

@tomerh2001
Copy link

tomerh2001 commented Sep 25, 2023

Hey, I just stumled across this amazing repo and I am thinking about integrating it with the CI/CD of our 14+ repos, that would help a lot.

I am using XO as my linter, and I'm wondering if Reviewdog supports it.

P.S. Am using bitbucket if that's releavnt

@dgholz
Copy link

dgholz commented May 9, 2024

@tomerh2001 XO is using the ESLint formatters under the hood, so you can use its SARIF formatter. Make an .reviewdog.yml like:

runner:
  xo:
    cmd: npx --no-install -c 'xo -f @microsoft/eslint-formatter-sarif'
    level: warning
    format: sarif

and a linting workflow in .github/workflows/js-lint.yml like:

name: Lint Javascript
on:
  - pull_request:

jobs:
  xo-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          cache: npm
          node-version-file: '.nvmrc'
      - uses: reviewdog/action-setup@v1
      - run: |
          reviewdog -reporter=github-pr-review -runners=xo --fail-on-error

And make sure you have xo & @microsoft/eslint-formatter-sarif listed as dependencies in your package.json

See https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#node-version-file if you want to pull your Node version from a different file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants