💅 noTypeOnlyImportAttributes errors are flagged when linter is diabled #4361
Labels
A-Linter
Area: linter
L-JavaScript
Language: JavaScript and super languages
S-Bug-confirmed
Status: report has been confirmed as a valid bug
Environment information
Rule name
noTypeOnlyImportAttributes
Playground link
https://biomejs.dev/playground/?enabledLinting=false&code=aQBtAHAAbwByAHQAIAB0AHkAcABlACAAKgAgAGEAcwAgAEYAbwBvACAAZgByAG8AbQAgACcAZgBvAG8AJwAgAHcAaQB0AGgAIAB7ACAAJwByAGUAcwBvAGwAdQB0AGkAbwBuAC0AbQBvAGQAZQAnADoAIAAnAGkAbQBwAG8AcgB0ACcAIAB9ADsACgAKAC8ALwAgAGIAaQBvAG0AZQAtAGkAZwBuAG8AcgBlACAAbABpAG4AdAA6ACAARABvAGUAcwBuACcAdAAgAHMAdQBwAHAAbwByAHQAIABiAGUAaQBuAGcAIABkAGkAcwBhAGIAbABlAGQAIABkAGkAcgBlAGMAdABsAHkACgBpAG0AcABvAHIAdAAgAHQAeQBwAGUAIAAqACAAYQBzACAAQgBhAHIAIABmAHIAbwBtACAAJwBiAGEAcgAnACAAdwBpAHQAaAAgAHsAIAAnAHIAZQBzAG8AbAB1AHQAaQBvAG4ALQBtAG8AZABlACcAOgAgACcAaQBtAHAAbwByAHQAJwAgAH0AOwA%3D
Expected result
The linter error
should not be flagged on this file because linting has been disabled.
See the "linter enabled" checkbox on the side of playground, which to my knowledge is the equivalent to
setting in a
biome.json
file.Note that it is a linter error (not a formatter) because it can be manually disabled via an ignore lint comment.
I'm not sure if related, but this rule does not show up in the config: https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/configuration_schema.json#L720 so I'm also not able to explicitly disable it in biome.json (although again I would expect a global enabled=false to cover it already)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
As far as I am concerned, simply allowing me to disable this rule alongside the rest of linting is good enough for me.
That being said, I would also disagree with the logic of this rule for certain use cases
When writing a CJS file and importing from an ESM file, typescript requires this annotation:
See a similar discussion in a previous issue: #2115
Where I actually moved over to this approach as a workaround initially.
This would require biome to have typescript knowledge of "this is CJS and target is ESM", which I'm not sure it is capable of today...
Code of Conduct
The text was updated successfully, but these errors were encountered: