Skip to content

linter: unicorn rules in config file are ignored #4701

@Kruptein

Description

@Kruptein

Given the following file (.oxlintrc.json):

{
    "rules": {
        "no-negated-condition": "allow"
    }
}

If I run the command oxlint -c .oxlintrc.json -D pedantic I get the following output:

× eslint-plugin-unicorn(no-negated-condition): Unexpected negated condition.
     ╭─[src/systems/dx/index.ts:123:25]
 122 │                     selectorValue:
 123 │                         part.groups.selval !== undefined ? Number.parseInt(part.groups.selval, 10) : undefined,
     ·                         ────────────────────────────────
 124 │                     status: Status.PendingRoll,
     ╰────
  help: Remove the negation operator and switch the consequent and alternate branches.

If I run it with oxlint -c .oxlintrc.json -D pedantic -A no-negated-condition however, the error no longer appears.

The same is true in the other direction, removing the -D pedantic and setting the rule to deny instead of allow in the config file does not make the error appear, whereas adding -D no-negated-condition to the command line does make it appear.

This behavior is not present for eslint and import rules (e.g. no-ternary works correctly in the config file), I've so far only seen the bug with the unicorn set of rules, but I haven't tested all of them.

tested on 0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory - Buggood first issueExperience Level - Good for newcomers

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions