Open kpvhn opened 1 year ago
This is working as intended. valid-typeof
is in a list of rules we intentionally disable only for .ts(x)
files because Typescript naturally covers the use-case. Keeping these rules on would slow down linting for no benefit.
When extending from
eslint:recommended
, eslint's built-invalid-typeof
is enabled.However, when further extending from
airbnb-typescript[/base]
,valid-typeof
is not enforced any more for TypeScript files but is still working for JavaScript files.It also works when I explicitly specify the
valid-typeof
rule myself in.eslintrc.cjs
, line 15.In the attached example, run
npm run lint
to lintj.js
andt.ts
.As you can see, the error in
j.js
will always show whereas the same error int.ts
does not appear if I extend fromairbnb-typescript[/base]
and do not explicitly specifyvalid-typeof
myself.However, as you can see with
npm run rules
, eslint lists thevalid-typeof
rule in all cases, so it is supposed to be working, as is also indicated by the error inj.js
.It looks like the rule check is somehow skipped for TypeScript.
valid-typeof.tgz