Skip to content

linter: oxlint --type-aware fails silently if oxlint-tsgolint is not installed #23686

Description

@mattrubin

What version of Oxlint are you using?

1.70.0

What command did you run?

npx oxlint . --type-aware

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

This issue repros both with no config file and with the default config file created by npx oxlint --init.

What happened?

If I run npx oxlint --type-aware when oxlint-tsgolint is not installed, oxlint prints nothing and exits with exit code 1.

Expected behavior:

oxlint should print an error message indicating failure and communicating that it cannot run type-aware rules without oxlint-tsgolint.

Steps to reproduce:

$ mkdir new-package
$ cd new-package
$ npm init -y
# Wrote to /Users/matt/Projects/TMP/new-package/package.json:
#
# {
#   "name": "new-package",
#   "version": "1.0.0",
#   "description": "",
#   "main": "index.js",
#   "scripts": {
#     "test": "echo \"Error: no test specified\" && exit 1"
#   },
#   "keywords": [],
#   "author": "",
#   "license": "ISC",
#   "type": "commonjs"
# }
#
#
$ npm i -D oxlint
#
# added 2 packages, and audited 3 packages in 587ms
#
# 1 package is looking for funding
#   run `npm fund` for details
#
# found 0 vulnerabilities
$ echo "export default {}" > index.ts


$ npx oxlint .
# Found 0 warnings and 0 errors.
# Finished in 9ms on 1 file with 95 rules using 18 threads.
$ echo $?
# 0


$ npx oxlint . --type-aware
$ echo $?
# 1


$ npm i -D oxlint-tsgolint
#
# added 2 packages, and audited 5 packages in 732ms
#
# 1 package is looking for funding
#   run `npm fund` for details
#
# found 0 vulnerabilities
$ npx oxlint . --type-aware
# Found 0 warnings and 0 errors.
# Finished in 699ms on 1 file with 110 rules using 18 threads.
$ echo $?
# 0

Metadata

Metadata

Assignees

Labels

Type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions