oxc
oxc copied to clipboard
linter: `@typescript-eslint/consistent-type-imports` should also support `experimentalDecorators` and `emitDecoratorMetadata`
What version of Oxlint are you using?
0.10.2
What command did you run?
oxlint -c oxlintrc.json --quiet
What does your .oxlint.json
config file look like?
{
"rules": {
"@typescript-eslint/consistent-type-imports": "error"
}
}
What happened?
I got some false positives by that rule, but after investigation I found that current rule just not fully support all cases as original eslint rule. Especially combinations of emitDecoratorMetadata
and experimentalDecorators
.
https://github.com/oxc-project/oxc/blob/ec5a19b880dc550c3ca53e25ae5f78f63bf5d4cb/crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs#L1339-L1340
Real use case: support is important for Angular framework where passed to constructor params with Types are values, due to Dependency Injection not just types.
Link to original rule with details about emitDecoratorMetadata
and experimentalDecorators
: https://typescript-eslint.io/rules/consistent-type-imports/#caveat-decorators--experimentaldecorators-true--emitdecoratormetadata-true