Skip to content

oxlint json parse failure fallback#37

Open
jbolda wants to merge 2 commits into
mainfrom
lint-noop-non-json
Open

oxlint json parse failure fallback#37
jbolda wants to merge 2 commits into
mainfrom
lint-noop-non-json

Conversation

@jbolda

@jbolda jbolda commented Jun 13, 2026

Copy link
Copy Markdown

What does this PR do?

In some failure or no-op cases, oxlint seems to return output which is not json-parseable even with --json passed. I suspect these are mostly edge cases which we don't highly value handling. Went with a simple try/catch and log out the result instead.

Example

https://github.com/bombshell-dev/repo v0.0.0 using v22.14.0
❯ pnpm lint

> @bomb.sh/ui-workspace@0.0.0 lint /dev/github/bombshell-dev/repo
> bsh lint

SyntaxError: Unexpected token 'N', "No files f"... is not valid JSON
    at JSON.parse (<anonymous>)
    at runOxlint (file:///dev/github/bombshell-dev/repo/node_modules/.pnpm/@bomb.sh+tools@0.5.1_oxc-resolver@11.20.0_vite@8.0.16_jiti@2.7.0_yaml@2.9.0_/node_modules/@bomb.sh/tools/dist/commands/lint.mjs:16:15)
    at async Promise.allSettled (index 0)
    at async collectViolations (file:///dev/github/bombshell-dev/repo/node_modules/.pnpm/@bomb.sh+tools@0.5.1_oxc-resolver@11.20.0_vite@8.0.16_jiti@2.7.0_yaml@2.9.0_/node_modules/@bomb.sh/tools/dist/commands/lint.mjs:149:18)
    at async lint (file:///dev/github/bombshell-dev/repo/node_modules/.pnpm/@bomb.sh+tools@0.5.1_oxc-resolver@11.20.0_vite@8.0.16_jiti@2.7.0_yaml@2.9.0_/node_modules/@bomb.sh/tools/dist/commands/lint.mjs:172:21)
    at async main (file:///dev/github/bombshell-dev/repo/node_modules/.pnpm/@bomb.sh+tools@0.5.1_oxc-resolver@11.20.0_vite@8.0.16_jiti@2.7.0_yaml@2.9.0_/node_modules/@bomb.sh/tools/dist/bin.mjs:33:2)

packages/new-pkg/src/index.ts
  -       warning     Unused file  knip/unused-file

1 warning

Result

https://github.com/bombshell-dev/repo on main [!] v0.0.0 using v22.14.0 took 2s
❯ pnpm lint

> @bomb.sh/new-repo-workspace@0.0.0 lint /dev/github/bombshell-dev/repo
> bsh lint

No files found to lint. Please check your paths and ignore patterns.
{ "diagnostics": [],
              "number_of_files": 0,
              "number_of_rules": 145,
              "threads_count": 8,
              "start_time": 0.084649375
            }


No issues found.

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@changeset-bot

changeset-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: acf2725

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bomb.sh/tools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@bomb.sh/tools@37

commit: acf2725

@dreyfus92 dreyfus92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, have you tested this fix already? 👀

@jbolda

jbolda commented Jun 13, 2026

Copy link
Copy Markdown
Author

Aye, the "Result" snippet is running the preview package in the same repo!

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

Successfully merging this pull request may close these issues.

2 participants