fix: read the repository's own oxlint configuration - #4087
Open
mhalikosen wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
The repository's oxlint configuration is never read. oxlint discovers its config as
.oxlintrc.json(seeoxlint --help, andnestjs/nest, which uses that name); the file here isoxlintrc.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:
oxlint lib/oxlintrc.json(today)no-useless-escape.oxlintrc.jsonno-useless-escapesilentThe 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.ignorePatternswas equally inert.What is the new behavior?
The file is renamed to
.oxlintrc.jsonand is picked up. Contents are unchanged, and the rename is the whole diff.Does this PR introduce a breaking change?
Other information
The same mistake exists in
nestjs/schematics, both in the repository root and in the project templatesnest newgenerates, 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.