Skip to content

fix: read the repository's own oxlint configuration - #4087

Open
mhalikosen wants to merge 1 commit into
nestjs:masterfrom
mhalikosen:fix/read-the-oxlint-config
Open

fix: read the repository's own oxlint configuration#4087
mhalikosen wants to merge 1 commit into
nestjs:masterfrom
mhalikosen:fix/read-the-oxlint-config

Conversation

@mhalikosen

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

The repository's oxlint configuration is never read. oxlint discovers its config as .oxlintrc.json (see oxlint --help, and nestjs/nest, which uses that name); the file here is oxlintrc.json, and "lint": "oxlint lib/" passes no -c. Everything in the file is therefore inert, silently: no error is reported for a config that is not found.

Measured on master, with oxlint 1.80.0:

config file name oxlint lib/
oxlintrc.json (today) 15 warnings, two of them no-useless-escape
.oxlintrc.json 13 warnings, no-useless-escape silent

The two warnings that disappear are exactly the ones "no-useless-escape": "off" is there to turn off, so the difference is proof the file is being read for the first time. ignorePatterns was equally inert.

What is the new behavior?

The file is renamed to .oxlintrc.json and is picked up. Contents are unchanged, and the rename is the whole diff.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The same mistake exists in nestjs/schematics, both in the repository root and in the project templates nest new generates, where it means every generated project ships a lint config that does nothing: nestjs/schematics#2431, with a fix in nestjs/schematics#2432. This PR is independent of those and only covers this repository.

oxlint discovers its configuration as `.oxlintrc.json`; the file here is
named `oxlintrc.json` and the lint script passes no `-c`, so the config is
never read and every rule in it is silently inert.

Renaming the file makes it take effect: `oxlint lib/` reports 15 warnings
against master and 13 with the file renamed, the two that disappear being
the `no-useless-escape` occurrences the config already turns off.
`ignorePatterns` was equally inert.
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.

1 participant