-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedThis 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.Please 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-pluginIssues related to @typescript-eslint/eslint-plugin
Milestone
Description
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:
no-require-imports
comes from TSLint: feat(eslint-plugin): add new rule no-require-imports #199no-var-requires
comes from eslint-plugin-typescript: New: Add no-var-requires bradzacher/eslint-plugin-typescript#114 => 470c264 which in turn comes from TSLint!
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.
JoshuaKGoldberg
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedThis 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.Please 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-pluginIssues related to @typescript-eslint/eslint-plugin