Skip to content

linter: typescript/no-unecessary-type-conversion rule does not work #20204

@abstractalgo

Description

@abstractalgo

What version of Oxlint are you using?

1.52.0

What command did you run?

bun run oxlint --type-aware

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

Config is from the repro repo (see below):
https://github.com/abstractalgo/oxlint-no-unecessary-type-conversion-repro/blob/master/.oxlintrc.json

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["typescript"],
  "options": {
    "typeAware": true
  },
  "categories": {},
  "rules": {
    "typescript/no-unecessary-type-conversion": "error",
    "typescript/no-non-null-assertion": "error"
  },
  "settings": {
    "jsx-a11y": {
      "polymorphicPropName": null,
      "components": {},
      "attributes": {}
    },
    "next": {
      "rootDir": []
    },
    "react": {
      "formComponents": [],
      "linkComponents": [],
      "version": null,
      "componentWrapperFunctions": []
    },
    "jsdoc": {
      "ignorePrivate": false,
      "ignoreInternal": false,
      "ignoreReplacesDocs": true,
      "overrideReplacesDocs": true,
      "augmentsExtendsReplacesDocs": false,
      "implementsReplacesDocs": false,
      "exemptDestructuredRootsFromChecks": false,
      "tagNamePreference": {}
    },
    "vitest": {
      "typecheck": false
    }
  },
  "env": {
    "builtin": true
  },
  "globals": {},
  "ignorePatterns": []
}

What happened?

oxlint 1.52.0 added this rule (release notes), but it's not working.

Here's the repro repo: https://github.com/abstractalgo/oxlint-no-unecessary-type-conversion-repro

As a comparison, I added a second typescript/* rule, and that one does work.

Repro: bun i + bun run oxlint + see /src/App.tsx file for where the error is supposed to be reported

Alternative repro on oxc playground.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions