Skip to content

Repo: deprecate no-var-requires in favor of no-require-imports #8092

Closed
@Josh-Cena

Description

@Josh-Cena

Suggestion

I was discussing this with @bradzacher and @JoshuaKGoldberg.

no-var-requires is a strict subset of no-require-imports: the former only detects require() expressions in very limited contexts (including variable declarations, new expressions, call expressions, member expressions). The latter bans all require expressions and import = require declarations.

They were both imported from other plugins:

Why TSLint has two rules remains unknown, but for the purpose of our maintenance I don't see why we need both. Let's implement no-var-requires as part of no-require-imports (an option called allowAsImport) instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions