oxc icon indicating copy to clipboard operation
oxc copied to clipboard

[Linter] Rule configuration severity is not enforced

Open jbanety opened this issue 5 months ago • 7 comments

I encountered an issue with the configuration of the @typescript-eslint/no-explicit-any rule in the eslintrc.json file. Despite the rule being set to "error", warnings are still being generated instead of errors.

Configuration

eslintrc.json

{
  "rules": {
    "@typescript-eslint/no-explicit-any": "error"
  }
}

Command line output

⚠ typescript-eslint(no-explicit-any): Unexpected any. Specify a different type.
     ╭─[src/helpers/htmlTemplate.ts:144:1]
 144 │ 
 145 │ export function renderHtml(template: string, data: Record<string, any> = {}): string {
     ·                                                                   ───
 146 │   // Render template
     ╰────
  help: Use `unknown` instead, this will force you to explicitly, and safely, assert the type is correct.

Finished in 20ms on 34 files with 83 rules using 16 threads.
Found 62 warnings and 0 errors.

PR https://github.com/oxc-project/oxc/pull/2031 fixed the off problem but not the severity. Tested on the latest 0.2.1.

jbanety avatar Jan 16 '24 13:01 jbanety