Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.
This repository was archived by the owner on May 12, 2025. It is now read-only.

eslint valid-typeof disabled by airbnb-typescript & airbnb-typescript/base when not explicitly added #327

@kpvhn

Description

@kpvhn

When extending from eslint:recommended, eslint's built-in valid-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 lint j.js and t.ts.

As you can see, the error in j.js will always show whereas the same error in t.ts does not appear if I extend from airbnb-typescript[/base] and do not explicitly specify valid-typeof myself.

However, as you can see with npm run rules, eslint lists the valid-typeof rule in all cases, so it is supposed to be working, as is also indicated by the error in j.js.

It looks like the rule check is somehow skipped for TypeScript.

valid-typeof.tgz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions