-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
I can't figure out how to use prefer-readonly-parameter-types
rule on interop with DOM (lib.dom typings).
Previously i using @typescript-eslint/eslint-plugin: ^2.20.0
and have code like this:
class SomeClass {
...
public someFunc(element: HTMLElement): void {
...
}
}
After update to 2.23.0
i got a eslint error
Parameter should be a read only typeeslint(@typescript-eslint/prefer-readonly-parameter-types)
This rule require something like
class SomeClass {
...
public someFunc(element: Readonly<HTMLElement>): void {
...
}
}
After that i got next error on the same place Make all properties in T readonly
.
It means that i should modify external library's code to fix that error, but it's impossible
I think that lib.dom (HTMLElement, etc) just 1 out of many errors from this rule on project-library interop layer.
This error caused by #1513
So I suggest to switch rule level from error
to warn
in packages/eslint-plugin/src/configs/all.json